diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9345fa..526efd2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log +## 29.0.0 + +* Breaking: requires PHP 8.5 or later, up from PHP 8.2 +* Breaking: HTTP transport rewritten on `utopia-php/client` (PSR-18), now a required dependency +* Breaking: `Execution.functionId` replaced by `resourceId` and `resourceType` +* Breaking: removed `dedicatedDatabases.execute` from `ProjectKeyScopes` +* Breaking: `Project.wafEnabled` is now nullable +* Added: `avatars.getPhoto`, with `userId`, `emailHash`, and `name` to resolve an avatar for someone other than the caller +* Added: `project.updateOAuth2HuggingFace`, the `OAuth2HuggingFace` model, and the `huggingface` OAuth provider +* Added: `scopes` parameter to `sites.create` and `sites.update`, and `Site.scopes` +* Added: `ExecutionResourceType` enum and the `bun-1.4` runtime +* Added: `Database` fields `containerStatus`, `error`, and `lifecycleState` +* Added: `BillingPlan` fields `supportsDedicatedDatabases` and `databaseComputeCredit` +* Added: `DatabaseMigration.changelogWatermark`, and `replicating` on `DatabaseStatusReplica` and `DedicatedDatabaseMember` +* Updated: enums now implement `Stringable` +* Updated: sources declare `strict_types` and ship `pint`, `phpstan`, and `rector` configs + + ## 28.0.0 * Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either diff --git a/README.md b/README.md index c5c62c7b..0afbcba6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ To install via [Composer](http://getcomposer.org/): composer require appwrite/appwrite ``` -Requires PHP 8.2 or later. +Requires PHP 8.5 or later. ## Getting Started diff --git a/composer.json b/composer.json index 54fa8a06..224788da 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,11 @@ "email": "team@appwrite.io" }, "scripts": { - "test": "vendor/bin/phpunit" + "test": "vendor/bin/phpunit", + "format": "vendor/bin/pint", + "lint": "vendor/bin/pint --test", + "analyse": "vendor/bin/phpstan analyse --memory-limit=1G", + "refactor": "vendor/bin/rector process --dry-run" }, "autoload": { "psr-4": { @@ -16,14 +20,19 @@ } }, "require": { - "php": ">=8.2.0", + "php": ">=8.5", "ext-curl": "*", "ext-json": "*", + "utopia-php/client": "^0.4.1", "adhocore/jwt": "^1.1" }, "require-dev": { + "laravel/pint": "^1.25", + "mockery/mockery": "1.6.15", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", "phpunit/phpunit": "^12", - "mockery/mockery": "1.6.12" + "rector/rector": "^2.2" }, "prefer-stable": true, "minimum-stability": "dev" diff --git a/docs/account.md b/docs/account.md index fcf89b5f..4ed44759 100644 --- a/docs/account.md +++ b/docs/account.md @@ -343,14 +343,14 @@ GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes ``` -** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** +** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** ```http request POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes ``` -** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** +** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. ** ```http request @@ -398,7 +398,7 @@ PATCH https://cloud.appwrite.io/v1/account/password PATCH https://cloud.appwrite.io/v1/account/phone ``` -** Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. ** +** Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. ** ### Parameters @@ -432,7 +432,7 @@ PATCH https://cloud.appwrite.io/v1/account/prefs POST https://cloud.appwrite.io/v1/account/recovery ``` -** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. ** +** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. ** ### Parameters @@ -542,7 +542,7 @@ POST https://cloud.appwrite.io/v1/account/sessions/token GET https://cloud.appwrite.io/v1/account/sessions/{sessionId} ``` -** Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. ** +** Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. ** ### Parameters @@ -555,7 +555,7 @@ GET https://cloud.appwrite.io/v1/account/sessions/{sessionId} PATCH https://cloud.appwrite.io/v1/account/sessions/{sessionId} ``` -** Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. ** +** Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. ** ### Parameters @@ -568,7 +568,7 @@ PATCH https://cloud.appwrite.io/v1/account/sessions/{sessionId} DELETE https://cloud.appwrite.io/v1/account/sessions/{sessionId} ``` -** Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. ** +** Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. ** ### Parameters @@ -588,7 +588,7 @@ PATCH https://cloud.appwrite.io/v1/account/status POST https://cloud.appwrite.io/v1/account/tokens/email ``` -** Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. +** Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). ** @@ -606,7 +606,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about POST https://cloud.appwrite.io/v1/account/tokens/magic-url ``` -** Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. +** Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). ** @@ -625,7 +625,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about GET https://cloud.appwrite.io/v1/account/tokens/oauth2/{provider} ``` -** Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. +** Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. @@ -635,7 +635,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about | Field Name | Type | Description | Default | | --- | --- | --- | --- | -| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | | +| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. | | | success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | | failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | | scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. | [] | @@ -645,7 +645,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about POST https://cloud.appwrite.io/v1/account/tokens/phone ``` -** Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. +** Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). ** @@ -661,7 +661,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about POST https://cloud.appwrite.io/v1/account/verifications/email ``` -** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. +** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. ** @@ -677,7 +677,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ POST https://cloud.appwrite.io/v1/account/verifications/email ``` -** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. +** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. ** @@ -721,14 +721,14 @@ PUT https://cloud.appwrite.io/v1/account/verifications/email POST https://cloud.appwrite.io/v1/account/verifications/phone ``` -** Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. ** +** Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. ** ```http request PUT https://cloud.appwrite.io/v1/account/verifications/phone ``` -** Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. ** +** Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. ** ### Parameters diff --git a/docs/advisor.md b/docs/advisor.md index e292c933..522c25a9 100644 --- a/docs/advisor.md +++ b/docs/advisor.md @@ -5,7 +5,7 @@ GET https://cloud.appwrite.io/v1/reports ``` -** Get a list of all the project's analyzer reports. You can use the query params to filter your results. +** Get a list of all the project's analyzer reports. You can use the query params to filter your results. ** ### Parameters @@ -20,7 +20,7 @@ GET https://cloud.appwrite.io/v1/reports GET https://cloud.appwrite.io/v1/reports/{reportId} ``` -** Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced. +** Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced. ** ### Parameters diff --git a/docs/apps.md b/docs/apps.md index 436275b2..fde01429 100644 --- a/docs/apps.md +++ b/docs/apps.md @@ -194,7 +194,7 @@ GET https://cloud.appwrite.io/v1/apps/{appId}/keys POST https://cloud.appwrite.io/v1/apps/{appId}/keys ``` -** Create a new app key for an application. App keys carry no scopes; send one in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header to list the application's installations and create installation access tokens. ** +** Create a new app key for an application. App keys carry no scopes; send one in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header to list the application's installations and create installation access tokens. ** ### Parameters diff --git a/docs/avatars.md b/docs/avatars.md index 11722abf..d9f421f5 100644 --- a/docs/avatars.md +++ b/docs/avatars.md @@ -95,9 +95,9 @@ This endpoint does not follow HTTP redirects. ** GET https://cloud.appwrite.io/v1/avatars/initials ``` -** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. +** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. -You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. +You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. ** @@ -112,6 +112,28 @@ When one dimension is specified and the other is 0, the image is scaled with pre | background | string | Changes background color. By default a random color will be picked and stay will persistent to the given name. | | +```http request +GET https://cloud.appwrite.io/v1/avatars/photo +``` + +** Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback. + +The photo resolves for the currently authenticated user unless `userId` points at another user. Passing `emailHash` and/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the user's own identity photos, email, and name leave the chain so they never shadow the avatar being asked for. Emails are only ever accepted pre-hashed, so no address ends up in a URL. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| width | integer | Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256. | 256 | +| height | integer | Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256. | 256 | +| quality | integer | Output image quality between 0 and 100. Defaults to 100. | 100 | +| output | string | Output image format. Defaults to 'png'. | png | +| rating | string | Maximum image rating to fetch from Gravatar/Libravatar. Defaults to 'g'. | g | +| userId | string | User ID to resolve the photo for. Defaults to 'current()' for the currently authenticated user. | current() | +| emailHash | string | SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own photo sources. Pass the hash, never the address itself. | | +| name | string | Name to render initials from instead of the user's own photo sources. Max length: 128 chars. | | + + ```http request GET https://cloud.appwrite.io/v1/avatars/qr ``` diff --git a/docs/backups.md b/docs/backups.md index 24727348..67fa160c 100644 --- a/docs/backups.md +++ b/docs/backups.md @@ -32,7 +32,7 @@ POST https://cloud.appwrite.io/v1/backups/archives GET https://cloud.appwrite.io/v1/backups/archives/{archiveId} ``` -** Get a backup archive using it's ID. ** +** Get a backup archive using it's ID. ** ### Parameters @@ -90,7 +90,7 @@ POST https://cloud.appwrite.io/v1/backups/policies GET https://cloud.appwrite.io/v1/backups/policies/{policyId} ``` -** Get a backup policy using it's ID. ** +** Get a backup policy using it's ID. ** ### Parameters @@ -103,7 +103,7 @@ GET https://cloud.appwrite.io/v1/backups/policies/{policyId} PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId} ``` -** Update an existing policy using it's ID. ** +** Update an existing policy using it's ID. ** ### Parameters @@ -120,7 +120,7 @@ PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId} DELETE https://cloud.appwrite.io/v1/backups/policies/{policyId} ``` -** Delete a policy using it's ID. ** +** Delete a policy using it's ID. ** ### Parameters @@ -141,7 +141,7 @@ The restoration migration records the archived database in `resourceId` and `res To list every migration related to one database, use its canonical type in a nested `OR(AND(...), AND(...), AND(...))` across the root, parent, and destination relation pairs: `(resourceType, resourceId)`, `(parentResourceType, parentResourceId)`, and `(destinationResourceType, destinationResourceId)`. Legacy and TablesDB databases use `database`; the operational `resourceType` of a table migration is not rewritten to `tablesdb`. -When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. +When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. ** ### Parameters diff --git a/docs/databases.md b/docs/databases.md index f976fef2..4915ffbc 100644 --- a/docs/databases.md +++ b/docs/databases.md @@ -983,7 +983,7 @@ DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collecti GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents ``` -** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. ** +** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. ** ### Parameters diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 2a80ab61..b462ef80 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->createEmailPasswordSession( email: 'email@example.com', password: 'password' -);``` +); +``` diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 9c20e746..1494943f 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -15,4 +15,5 @@ $result = $account->createEmailToken( userId: '', email: 'email@example.com', phrase: false // optional -);``` +); +``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index 650f5777..de0eab93 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->createEmailVerification( url: 'https://example.com' -);``` +); +``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index a4dde3d7..9c31a513 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -16,4 +16,5 @@ $result = $account->createMagicURLToken( email: 'email@example.com', url: 'https://example.com', // optional phrase: false // optional -);``` +); +``` diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index fbbc193f..75d848d0 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->createMFAAuthenticator( type: AuthenticatorType::TOTP() -);``` +); +``` diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 08bf57d8..3b370030 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->createMFAChallenge( factor: AuthenticationFactor::EMAIL() -);``` +); +``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 170192d6..db4dc650 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -17,4 +17,5 @@ $result = $account->createOAuth2Token( success: 'https://example.com', // optional failure: 'https://example.com', // optional scopes: [] // optional -);``` +); +``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index f48754f5..bf56212e 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->createPhoneToken( userId: '', phone: '+12065550100' -);``` +); +``` diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index c6eaadaf..24d308c2 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->createRecovery( email: 'email@example.com', url: 'https://example.com' -);``` +); +``` diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 6e339b09..d40041f7 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->createSession( userId: '', secret: '' -);``` +); +``` diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 2266a0f1..72fa5a9a 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->createVerification( url: 'https://example.com' -);``` +); +``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 123538ca..b4f8c1c6 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -16,4 +16,5 @@ $result = $account->create( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); +``` diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md index 1cb8fcce..8db797b4 100644 --- a/docs/examples/account/delete-consent-token.md +++ b/docs/examples/account/delete-consent-token.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->deleteConsentToken( consentId: '', tokenId: '' -);``` +); +``` diff --git a/docs/examples/account/delete-consent.md b/docs/examples/account/delete-consent.md index 0aebb0a5..e7457d49 100644 --- a/docs/examples/account/delete-consent.md +++ b/docs/examples/account/delete-consent.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->deleteConsent( consentId: '' -);``` +); +``` diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 56db56fd..15f7fa5f 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->deleteIdentity( identityId: '' -);``` +); +``` diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index c171381d..dd434416 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->deleteMFAAuthenticator( type: AuthenticatorType::TOTP() -);``` +); +``` diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index b200785f..498b0c47 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->deleteSession( sessionId: '' -);``` +); +``` diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md index dda1a1ca..4667c5c9 100644 --- a/docs/examples/account/get-consent-token.md +++ b/docs/examples/account/get-consent-token.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->getConsentToken( consentId: '', tokenId: '' -);``` +); +``` diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md index f6ce59fc..2b22510e 100644 --- a/docs/examples/account/get-consent.md +++ b/docs/examples/account/get-consent.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->getConsent( consentId: '' -);``` +); +``` diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 7e79a07f..15a99f2b 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->getSession( sessionId: '' -);``` +); +``` diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md index 0088745c..84824947 100644 --- a/docs/examples/account/list-consent-tokens.md +++ b/docs/examples/account/list-consent-tokens.md @@ -15,4 +15,5 @@ $result = $account->listConsentTokens( consentId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/account/list-consents.md b/docs/examples/account/list-consents.md index b2c63a30..9b2255ef 100644 --- a/docs/examples/account/list-consents.md +++ b/docs/examples/account/list-consents.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->listConsents( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 1bd2ef02..69c8bbbb 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->listIdentities( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 763b7727..17e51352 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->listLogs( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index 2fa17a54..1c363e97 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updateEmailVerification( userId: '', secret: '' -);``` +); +``` diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 8cdfc5f1..fb207913 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updateEmail( email: 'email@example.com', password: 'password' -);``` +); +``` diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index 055f0664..3fd0179f 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updateMagicURLSession( userId: '', secret: '' -);``` +); +``` diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index c2f9dd66..d02e79ce 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -15,4 +15,5 @@ $account = new Account($client); $result = $account->updateMFAAuthenticator( type: AuthenticatorType::TOTP(), otp: '' -);``` +); +``` diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index effbb172..bc829a6e 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updateMFAChallenge( challengeId: '', otp: '' -);``` +); +``` diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index 3d2f9b62..2d1f35af 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->updateMFA( mfa: false -);``` +); +``` diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 4a34bc32..9ebb4381 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->updateName( name: '' -);``` +); +``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 13f03c87..c9e0fc55 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updatePassword( password: 'password', oldPassword: 'password' // optional -);``` +); +``` diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 67b5816d..f547ca97 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updatePhoneSession( userId: '', secret: '' -);``` +); +``` diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 877a0346..cbc6790c 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updatePhoneVerification( userId: '', secret: '' -);``` +); +``` diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 6b5e9cad..b9fe2bd3 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updatePhone( phone: '+12065550100', password: 'password' -);``` +); +``` diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 4709edd2..9176756b 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -17,4 +17,5 @@ $result = $account->updatePrefs( 'timezone' => 'UTC', 'darkTheme' => true ] -);``` +); +``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 23a626e3..eb540c39 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -15,4 +15,5 @@ $result = $account->updateRecovery( userId: '', secret: '', password: 'password' -);``` +); +``` diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index aecf2fe8..b98cb3bd 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -13,4 +13,5 @@ $account = new Account($client); $result = $account->updateSession( sessionId: '' -);``` +); +``` diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 24bb3ff0..a84126d4 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -14,4 +14,5 @@ $account = new Account($client); $result = $account->updateVerification( userId: '', secret: '' -);``` +); +``` diff --git a/docs/examples/activities/get-event.md b/docs/examples/activities/get-event.md index 6b8f5421..d4b7f3f5 100644 --- a/docs/examples/activities/get-event.md +++ b/docs/examples/activities/get-event.md @@ -13,4 +13,5 @@ $activities = new Activities($client); $result = $activities->getEvent( eventId: '' -);``` +); +``` diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index cab59cfc..3ffec877 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -13,4 +13,5 @@ $activities = new Activities($client); $result = $activities->listEvents( queries: [] // optional -);``` +); +``` diff --git a/docs/examples/advisor/delete-report.md b/docs/examples/advisor/delete-report.md index 997fd5e9..41d2e336 100644 --- a/docs/examples/advisor/delete-report.md +++ b/docs/examples/advisor/delete-report.md @@ -13,4 +13,5 @@ $advisor = new Advisor($client); $result = $advisor->deleteReport( reportId: '' -);``` +); +``` diff --git a/docs/examples/advisor/get-insight.md b/docs/examples/advisor/get-insight.md index 421a8476..812ee9bc 100644 --- a/docs/examples/advisor/get-insight.md +++ b/docs/examples/advisor/get-insight.md @@ -14,4 +14,5 @@ $advisor = new Advisor($client); $result = $advisor->getInsight( reportId: '', insightId: '' -);``` +); +``` diff --git a/docs/examples/advisor/get-report.md b/docs/examples/advisor/get-report.md index 8baacab7..1379419c 100644 --- a/docs/examples/advisor/get-report.md +++ b/docs/examples/advisor/get-report.md @@ -13,4 +13,5 @@ $advisor = new Advisor($client); $result = $advisor->getReport( reportId: '' -);``` +); +``` diff --git a/docs/examples/advisor/list-insights.md b/docs/examples/advisor/list-insights.md index 10cf4fd9..d475153c 100644 --- a/docs/examples/advisor/list-insights.md +++ b/docs/examples/advisor/list-insights.md @@ -15,4 +15,5 @@ $result = $advisor->listInsights( reportId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/advisor/list-reports.md b/docs/examples/advisor/list-reports.md index 29c42206..9dc55cae 100644 --- a/docs/examples/advisor/list-reports.md +++ b/docs/examples/advisor/list-reports.md @@ -14,4 +14,5 @@ $advisor = new Advisor($client); $result = $advisor->listReports( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md index 33d117ae..1e8323e1 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->createInstallationToken( appId: '', installationId: '' -);``` +); +``` diff --git a/docs/examples/apps/create-key.md b/docs/examples/apps/create-key.md index 7690aeaa..0f7d69b4 100644 --- a/docs/examples/apps/create-key.md +++ b/docs/examples/apps/create-key.md @@ -13,4 +13,5 @@ $apps = new Apps($client); $result = $apps->createKey( appId: '' -);``` +); +``` diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md index cff66b3b..59336de4 100644 --- a/docs/examples/apps/create-secret.md +++ b/docs/examples/apps/create-secret.md @@ -13,4 +13,5 @@ $apps = new Apps($client); $result = $apps->createSecret( appId: '' -);``` +); +``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md index 8c7c2869..459786ed 100644 --- a/docs/examples/apps/create.md +++ b/docs/examples/apps/create.md @@ -31,4 +31,5 @@ $result = $apps->create( type: 'public', // optional deviceFlow: false, // optional teamId: '' // optional -);``` +); +``` diff --git a/docs/examples/apps/delete-installation.md b/docs/examples/apps/delete-installation.md index e57a12f4..e6c89fda 100644 --- a/docs/examples/apps/delete-installation.md +++ b/docs/examples/apps/delete-installation.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->deleteInstallation( appId: '', installationId: '' -);``` +); +``` diff --git a/docs/examples/apps/delete-key.md b/docs/examples/apps/delete-key.md index d07194eb..a178c1d7 100644 --- a/docs/examples/apps/delete-key.md +++ b/docs/examples/apps/delete-key.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->deleteKey( appId: '', keyId: '' -);``` +); +``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md index df614d6a..947efae1 100644 --- a/docs/examples/apps/delete-secret.md +++ b/docs/examples/apps/delete-secret.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->deleteSecret( appId: '', secretId: '' -);``` +); +``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md index 200cb924..bca4ae85 100644 --- a/docs/examples/apps/delete-tokens.md +++ b/docs/examples/apps/delete-tokens.md @@ -13,4 +13,5 @@ $apps = new Apps($client); $result = $apps->deleteTokens( appId: '' -);``` +); +``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md index 38cfcf55..b0d4c61e 100644 --- a/docs/examples/apps/delete.md +++ b/docs/examples/apps/delete.md @@ -13,4 +13,5 @@ $apps = new Apps($client); $result = $apps->delete( appId: '' -);``` +); +``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index 0f7a9bac..75ab80c3 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->getInstallation( appId: '', installationId: '' -);``` +); +``` diff --git a/docs/examples/apps/get-key.md b/docs/examples/apps/get-key.md index 78e30e19..a45ee7b7 100644 --- a/docs/examples/apps/get-key.md +++ b/docs/examples/apps/get-key.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->getKey( appId: '', keyId: '' -);``` +); +``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md index ef4c1d4f..c55906ac 100644 --- a/docs/examples/apps/get-secret.md +++ b/docs/examples/apps/get-secret.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->getSecret( appId: '', secretId: '' -);``` +); +``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md index 7c9ce18a..1324923d 100644 --- a/docs/examples/apps/get.md +++ b/docs/examples/apps/get.md @@ -13,4 +13,5 @@ $apps = new Apps($client); $result = $apps->get( appId: '' -);``` +); +``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index 0209cd24..08dd109f 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -15,4 +15,5 @@ $result = $apps->listInstallations( appId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/apps/list-keys.md b/docs/examples/apps/list-keys.md index 8d816537..33a9fdf9 100644 --- a/docs/examples/apps/list-keys.md +++ b/docs/examples/apps/list-keys.md @@ -15,4 +15,5 @@ $result = $apps->listKeys( appId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md index 341fa345..bbfeac40 100644 --- a/docs/examples/apps/list-secrets.md +++ b/docs/examples/apps/list-secrets.md @@ -15,4 +15,5 @@ $result = $apps->listSecrets( appId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md index 9add376d..e92a0fdb 100644 --- a/docs/examples/apps/list.md +++ b/docs/examples/apps/list.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->list( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/apps/update-labels.md b/docs/examples/apps/update-labels.md index e3786e42..8ab41d2b 100644 --- a/docs/examples/apps/update-labels.md +++ b/docs/examples/apps/update-labels.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->updateLabels( appId: '', labels: [] -);``` +); +``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md index 76ea6ce2..38580979 100644 --- a/docs/examples/apps/update-team.md +++ b/docs/examples/apps/update-team.md @@ -14,4 +14,5 @@ $apps = new Apps($client); $result = $apps->updateTeam( appId: '', teamId: '' -);``` +); +``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md index 5d914c74..5d72dc0a 100644 --- a/docs/examples/apps/update.md +++ b/docs/examples/apps/update.md @@ -32,4 +32,5 @@ $result = $apps->update( deviceFlow: false, // optional installationScopes: [], // optional installationRedirectUrl: 'https://example.com' // optional -);``` +); +``` diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index ec2a7599..ccf98858 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -17,4 +17,5 @@ $result = $avatars->getBrowser( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); +``` diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 05ddc247..ff4fd2b3 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -17,4 +17,5 @@ $result = $avatars->getCreditCard( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); +``` diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 424cea84..346f46d1 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -13,4 +13,5 @@ $avatars = new Avatars($client); $result = $avatars->getFavicon( url: 'https://example.com' -);``` +); +``` diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 1a4ef37a..e2b455b3 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -17,4 +17,5 @@ $result = $avatars->getFlag( width: 0, // optional height: 0, // optional quality: -1 // optional -);``` +); +``` diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 4ceb8d38..2ca26019 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -15,4 +15,5 @@ $result = $avatars->getImage( url: 'https://example.com', width: 0, // optional height: 0 // optional -);``` +); +``` diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 2bd523b5..88f45c16 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -16,4 +16,5 @@ $result = $avatars->getInitials( width: 0, // optional height: 0, // optional background: '' // optional -);``` +); +``` diff --git a/docs/examples/avatars/get-photo.md b/docs/examples/avatars/get-photo.md new file mode 100644 index 00000000..5e8af418 --- /dev/null +++ b/docs/examples/avatars/get-photo.md @@ -0,0 +1,24 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$avatars = new Avatars($client); + +$result = $avatars->getPhoto( + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: '', // optional + emailHash: '', // optional + name: '' // optional +); +``` diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index ad49bf9e..ec6e3441 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -16,4 +16,5 @@ $result = $avatars->getQR( size: 1, // optional margin: 0, // optional download: false // optional -);``` +); +``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index d2381633..59fbd663 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -39,4 +39,5 @@ $result = $avatars->getScreenshot( height: 600, // optional quality: 85, // optional output: ImageFormat::JPEG() // optional -);``` +); +``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md index d73db2e2..77d51a46 100644 --- a/docs/examples/backups/create-archive.md +++ b/docs/examples/backups/create-archive.md @@ -15,4 +15,5 @@ $backups = new Backups($client); $result = $backups->createArchive( services: [BackupServices::DATABASES()], resourceId: '' // optional -);``` +); +``` diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md index ea87f280..301cec37 100644 --- a/docs/examples/backups/create-policy.md +++ b/docs/examples/backups/create-policy.md @@ -20,4 +20,5 @@ $result = $backups->createPolicy( name: '', // optional resourceId: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 61d9e0b2..8b7b1e70 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -17,4 +17,5 @@ $result = $backups->createRestoration( services: [BackupServices::DATABASES()], newResourceId: '', // optional newResourceName: '' // optional -);``` +); +``` diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md index a6c3d332..444146f2 100644 --- a/docs/examples/backups/delete-archive.md +++ b/docs/examples/backups/delete-archive.md @@ -13,4 +13,5 @@ $backups = new Backups($client); $result = $backups->deleteArchive( archiveId: '' -);``` +); +``` diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md index 3c6df8f4..a8d96498 100644 --- a/docs/examples/backups/delete-policy.md +++ b/docs/examples/backups/delete-policy.md @@ -13,4 +13,5 @@ $backups = new Backups($client); $result = $backups->deletePolicy( policyId: '' -);``` +); +``` diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md index 6fa9ea93..7f5f79a4 100644 --- a/docs/examples/backups/get-archive.md +++ b/docs/examples/backups/get-archive.md @@ -13,4 +13,5 @@ $backups = new Backups($client); $result = $backups->getArchive( archiveId: '' -);``` +); +``` diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md index e8ce5c8f..a24d8cf6 100644 --- a/docs/examples/backups/get-policy.md +++ b/docs/examples/backups/get-policy.md @@ -13,4 +13,5 @@ $backups = new Backups($client); $result = $backups->getPolicy( policyId: '' -);``` +); +``` diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md index ed3e94ab..9b97e471 100644 --- a/docs/examples/backups/get-restoration.md +++ b/docs/examples/backups/get-restoration.md @@ -13,4 +13,5 @@ $backups = new Backups($client); $result = $backups->getRestoration( restorationId: '' -);``` +); +``` diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md index 4060e3c0..af9f412a 100644 --- a/docs/examples/backups/list-archives.md +++ b/docs/examples/backups/list-archives.md @@ -13,4 +13,5 @@ $backups = new Backups($client); $result = $backups->listArchives( queries: [] // optional -);``` +); +``` diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md index a8b03316..f9775cd4 100644 --- a/docs/examples/backups/list-policies.md +++ b/docs/examples/backups/list-policies.md @@ -13,4 +13,5 @@ $backups = new Backups($client); $result = $backups->listPolicies( queries: [] // optional -);``` +); +``` diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md index 2c7132b2..a02a1cb7 100644 --- a/docs/examples/backups/list-restorations.md +++ b/docs/examples/backups/list-restorations.md @@ -13,4 +13,5 @@ $backups = new Backups($client); $result = $backups->listRestorations( queries: [] // optional -);``` +); +``` diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md index fe53fa2b..54d8adcb 100644 --- a/docs/examples/backups/update-policy.md +++ b/docs/examples/backups/update-policy.md @@ -17,4 +17,5 @@ $result = $backups->updatePolicy( retention: 1, // optional schedule: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index eea06b58..e746cffb 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -20,4 +20,5 @@ $result = $databases->createBigIntAttribute( max: null, // optional default: null, // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 746db6be..1cc6d1a3 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -18,4 +18,5 @@ $result = $databases->createBooleanAttribute( required: false, default: false, // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index a90e579b..5adf6f56 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -22,4 +22,5 @@ $result = $databases->createCollection( enabled: false, // optional attributes: [], // optional indexes: [] // optional -);``` +); +``` diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 862ed260..788eba63 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -18,4 +18,5 @@ $result = $databases->createDatetimeAttribute( required: false, default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index f8e7e943..efd3083f 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -26,4 +26,5 @@ $result = $databases->createDocument( ], permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index f4f153ae..1f64387b 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -16,4 +16,5 @@ $result = $databases->createDocuments( collectionId: '', documents: [], transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 4f53b8ac..fb2654a4 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -18,4 +18,5 @@ $result = $databases->createEmailAttribute( required: false, default: 'email@example.com', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 49eb90a5..4f77fcd1 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -19,4 +19,5 @@ $result = $databases->createEnumAttribute( required: false, default: '', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 60486bbb..c6946d79 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -20,4 +20,5 @@ $result = $databases->createFloatAttribute( max: null, // optional default: null, // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 9ecf25ab..6e5870a6 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -21,4 +21,5 @@ $result = $databases->createIndex( attributes: [], orders: [OrderBy::ASC()], // optional lengths: [] // optional -);``` +); +``` diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index e1c771fe..12b5f959 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -20,4 +20,5 @@ $result = $databases->createIntegerAttribute( max: null, // optional default: null, // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index b15fc386..27a934b6 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -18,4 +18,5 @@ $result = $databases->createIpAttribute( required: false, default: '', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index dd59e00b..80c8faa7 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -17,4 +17,5 @@ $result = $databases->createLineAttribute( key: '', required: false, default: [[1, 2], [3, 4], [5, 6]] // optional -);``` +); +``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index cc597b5a..91be4cee 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -19,4 +19,5 @@ $result = $databases->createLongtextAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index 16fbe809..4b369807 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -19,4 +19,5 @@ $result = $databases->createMediumtextAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index 10b2e6c5..82172a3f 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -24,4 +24,5 @@ $result = $databases->createOperations( } } ] // optional -);``` +); +``` diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 14ced405..94255f86 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -17,4 +17,5 @@ $result = $databases->createPointAttribute( key: '', required: false, default: [1, 2] // optional -);``` +); +``` diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 5886cf2c..6cccf534 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -17,4 +17,5 @@ $result = $databases->createPolygonAttribute( key: '', required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional -);``` +); +``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 739b27e2..3581c89d 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -22,4 +22,5 @@ $result = $databases->createRelationshipAttribute( key: '', // optional twoWayKey: '', // optional onDelete: RelationMutate::CASCADE() // optional -);``` +); +``` diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index e6da9507..34f13110 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -20,4 +20,5 @@ $result = $databases->createStringAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index 30067dce..b189babd 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -19,4 +19,5 @@ $result = $databases->createTextAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index 9ca80288..600cda58 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -13,4 +13,5 @@ $databases = new Databases($client); $result = $databases->createTransaction( ttl: 60 // optional -);``` +); +``` diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index c1b432df..c4706118 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -18,4 +18,5 @@ $result = $databases->createUrlAttribute( required: false, default: 'https://example.com', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 1ebbff5f..42d69aa2 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -20,4 +20,5 @@ $result = $databases->createVarcharAttribute( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 867c31c2..95f3cf40 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -15,4 +15,5 @@ $result = $databases->create( databaseId: '', name: '', enabled: false // optional -);``` +); +``` diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 2c00e787..82981200 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -19,4 +19,5 @@ $result = $databases->decrementDocumentAttribute( value: null, // optional min: null, // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index cc777436..84ba9901 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -15,4 +15,5 @@ $result = $databases->deleteAttribute( databaseId: '', collectionId: '', key: '' -);``` +); +``` diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 8419bc41..486b9f36 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -14,4 +14,5 @@ $databases = new Databases($client); $result = $databases->deleteCollection( databaseId: '', collectionId: '' -);``` +); +``` diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index c0c620bc..33f9e179 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -16,4 +16,5 @@ $result = $databases->deleteDocument( collectionId: '', documentId: '', transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index 124294dc..f39cbfe0 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -16,4 +16,5 @@ $result = $databases->deleteDocuments( collectionId: '', queries: [], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index d8106099..b752023d 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -15,4 +15,5 @@ $result = $databases->deleteIndex( databaseId: '', collectionId: '', key: '' -);``` +); +``` diff --git a/docs/examples/databases/delete-transaction.md b/docs/examples/databases/delete-transaction.md index 3e2db81e..09634f29 100644 --- a/docs/examples/databases/delete-transaction.md +++ b/docs/examples/databases/delete-transaction.md @@ -13,4 +13,5 @@ $databases = new Databases($client); $result = $databases->deleteTransaction( transactionId: '' -);``` +); +``` diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 9d89cfbc..6f25053a 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -13,4 +13,5 @@ $databases = new Databases($client); $result = $databases->delete( databaseId: '' -);``` +); +``` diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 4f3f7f77..cd77f506 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -15,4 +15,5 @@ $result = $databases->getAttribute( databaseId: '', collectionId: '', key: '' -);``` +); +``` diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index e3cccdf3..e8cdada6 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -14,4 +14,5 @@ $databases = new Databases($client); $result = $databases->getCollection( databaseId: '', collectionId: '' -);``` +); +``` diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 90f8760e..f0827f6e 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -17,4 +17,5 @@ $result = $databases->getDocument( documentId: '', queries: [], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 001fc6ed..a8cf9adb 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -15,4 +15,5 @@ $result = $databases->getIndex( databaseId: '', collectionId: '', key: '' -);``` +); +``` diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index 82b34ae6..23581685 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -13,4 +13,5 @@ $databases = new Databases($client); $result = $databases->getTransaction( transactionId: '' -);``` +); +``` diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 59a83bf9..8eb28cbe 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -13,4 +13,5 @@ $databases = new Databases($client); $result = $databases->get( databaseId: '' -);``` +); +``` diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 8782cf7d..30450c08 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -19,4 +19,5 @@ $result = $databases->incrementDocumentAttribute( value: null, // optional max: null, // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index dac753db..1867283b 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -16,4 +16,5 @@ $result = $databases->listAttributes( collectionId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 7f994e1d..29dd5ec2 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -16,4 +16,5 @@ $result = $databases->listCollections( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 8e318580..9e4d143f 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -18,4 +18,5 @@ $result = $databases->listDocuments( transactionId: '', // optional total: false, // optional ttl: 0 // optional -);``` +); +``` diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 1ebd2692..40b21bbd 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -16,4 +16,5 @@ $result = $databases->listIndexes( collectionId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index 8990c74e..97cb6abd 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -13,4 +13,5 @@ $databases = new Databases($client); $result = $databases->listTransactions( queries: [] // optional -);``` +); +``` diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index d439184a..f48d27ff 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -15,4 +15,5 @@ $result = $databases->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md index 5d0eb63e..44d70a99 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -20,4 +20,5 @@ $result = $databases->updateBigIntAttribute( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index f63e5f3f..a92a6999 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateBooleanAttribute( required: false, default: false, newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index ddd369b1..dc8e3522 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -21,4 +21,5 @@ $result = $databases->updateCollection( documentSecurity: false, // optional enabled: false, // optional purge: false // optional -);``` +); +``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 9bff9317..7158e915 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateDatetimeAttribute( required: false, default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 7a185451..1f3b6359 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -26,4 +26,5 @@ $result = $databases->updateDocument( ], // optional permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index c29a467d..68c12217 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -23,4 +23,5 @@ $result = $databases->updateDocuments( ], // optional queries: [], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index b4421d5e..6dfd6b6e 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateEmailAttribute( required: false, default: 'email@example.com', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index c2880f29..955e6c1e 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -19,4 +19,5 @@ $result = $databases->updateEnumAttribute( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 3ea48188..631a2807 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -20,4 +20,5 @@ $result = $databases->updateFloatAttribute( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 29b7ac6b..1feaf6ae 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -20,4 +20,5 @@ $result = $databases->updateIntegerAttribute( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index c7490c5f..fe9fb4bf 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateIpAttribute( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 7cb7dabb..008c041d 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateLineAttribute( required: false, default: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index d9a217d2..5b21ef0a 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateLongtextAttribute( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index bae03412..6288fee1 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateMediumtextAttribute( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 1359ec90..505944d4 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updatePointAttribute( required: false, default: [1, 2], // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index cf799969..e6a940bb 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updatePolygonAttribute( required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 824f1f71..38fc8dc7 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateRelationshipAttribute( key: '', onDelete: RelationMutate::CASCADE(), // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 828dda47..a3256386 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -19,4 +19,5 @@ $result = $databases->updateStringAttribute( default: '', size: 1, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 8de8c78c..ff4ce5d0 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateTextAttribute( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index 13137b6b..354d01bb 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -15,4 +15,5 @@ $result = $databases->updateTransaction( transactionId: '', commit: false, // optional rollback: false // optional -);``` +); +``` diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 461abf55..f03123c1 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -18,4 +18,5 @@ $result = $databases->updateUrlAttribute( required: false, default: 'https://example.com', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index 0c5dbbe8..03ea4c01 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -19,4 +19,5 @@ $result = $databases->updateVarcharAttribute( default: '', size: 1, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 67af71aa..bd56abc6 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -15,4 +15,5 @@ $result = $databases->update( databaseId: '', name: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 9b01b8c2..94aad582 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -26,4 +26,5 @@ $result = $databases->upsertDocument( ], // optional permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 5bc04d78..0049fdc6 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -16,4 +16,5 @@ $result = $databases->upsertDocuments( collectionId: '', documents: [], transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md index 15f92318..70f0f7e1 100644 --- a/docs/examples/embeddings/create-text-embeddings.md +++ b/docs/examples/embeddings/create-text-embeddings.md @@ -15,4 +15,5 @@ $embeddings = new Embeddings($client); $result = $embeddings->createTextEmbeddings( texts: [], model: EmbeddingModel::NOMICEMBEDTEXT() // optional -);``` +); +``` diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index cdee0ff9..673d21b4 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -18,4 +18,5 @@ $result = $functions->createDeployment( activate: false, entrypoint: '', // optional commands: '' // optional -);``` +); +``` diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index 0cf3a831..75cfedfc 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -15,4 +15,5 @@ $result = $functions->createDuplicateDeployment( functionId: '', deploymentId: '', buildId: '' // optional -);``` +); +``` diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 70a8fc06..94427dea 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -20,4 +20,5 @@ $result = $functions->createExecution( method: ExecutionMethod::GET(), // optional headers: [], // optional scheduledAt: '' // optional -);``` +); +``` diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index c6dae9a9..14ec5a73 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -20,4 +20,5 @@ $result = $functions->createTemplateDeployment( type: TemplateReferenceType::COMMIT(), reference: '', activate: false // optional -);``` +); +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 685a21aa..46406878 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -14,7 +14,8 @@ $functions = new Functions($client); $result = $functions->createVariable( functionId: '', variableId: '', - key: '', + key: '', value: '', secret: false // optional -);``` +); +``` diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index 5ccab950..ab9d0572 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -17,4 +17,5 @@ $result = $functions->createVcsDeployment( type: VCSReferenceType::BRANCH(), reference: '', activate: false // optional -);``` +); +``` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 4e8a23d7..83169340 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -36,4 +36,5 @@ $result = $functions->create( buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional -);``` +); +``` diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 96e78e3b..60e9cff7 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -14,4 +14,5 @@ $functions = new Functions($client); $result = $functions->deleteDeployment( functionId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index e95d2f70..9bf9e5d6 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -14,4 +14,5 @@ $functions = new Functions($client); $result = $functions->deleteExecution( functionId: '', executionId: '' -);``` +); +``` diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 9be2e174..25f41540 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -14,4 +14,5 @@ $functions = new Functions($client); $result = $functions->deleteVariable( functionId: '', variableId: '' -);``` +); +``` diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index d718bfbf..00431910 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -13,4 +13,5 @@ $functions = new Functions($client); $result = $functions->delete( functionId: '' -);``` +); +``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index e267d325..fb6d3d01 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -17,4 +17,5 @@ $result = $functions->getDeploymentDownload( deploymentId: '', type: DeploymentDownloadType::SOURCE(), // optional token: '' // optional -);``` +); +``` diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index f8d4a26e..1e264d85 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -14,4 +14,5 @@ $functions = new Functions($client); $result = $functions->getDeployment( functionId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index f647a7fd..b1be6b23 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -14,4 +14,5 @@ $functions = new Functions($client); $result = $functions->getExecution( functionId: '', executionId: '' -);``` +); +``` diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 8d408643..6b9a802e 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -14,4 +14,5 @@ $functions = new Functions($client); $result = $functions->getVariable( functionId: '', variableId: '' -);``` +); +``` diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index e5997ee2..8821156a 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -13,4 +13,5 @@ $functions = new Functions($client); $result = $functions->get( functionId: '' -);``` +); +``` diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index bc46662a..de89fe38 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -16,4 +16,5 @@ $result = $functions->listDeployments( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 9948e862..9b1fc5b5 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -15,4 +15,5 @@ $result = $functions->listExecutions( functionId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 7211ce69..da2bec2e 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -13,4 +13,5 @@ $functions = new Functions($client); $result = $functions->listSpecifications( type: 'runtimes' // optional -);``` +); +``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 33d09ddf..1cc854cc 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -15,4 +15,5 @@ $result = $functions->listVariables( functionId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 2dc45db0..4775e062 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -15,4 +15,5 @@ $result = $functions->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index 311645e5..c8984428 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -14,4 +14,5 @@ $functions = new Functions($client); $result = $functions->updateDeploymentStatus( functionId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index b1c0edb7..5aa5a266 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -14,4 +14,5 @@ $functions = new Functions($client); $result = $functions->updateFunctionDeployment( functionId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index c4b9a4c3..14a284d6 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -14,7 +14,8 @@ $functions = new Functions($client); $result = $functions->updateVariable( functionId: '', variableId: '', - key: '', // optional + key: '', // optional value: '', // optional secret: false // optional -);``` +); +``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 4eaeb871..e857349a 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -36,4 +36,5 @@ $result = $functions->update( buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional -);``` +); +``` diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 1e25bf73..c2f1b989 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -13,4 +13,5 @@ $graphql = new Graphql($client); $result = $graphql->mutation( query: [] -);``` +); +``` diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 90979942..9731e998 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -13,4 +13,5 @@ $graphql = new Graphql($client); $result = $graphql->query( query: [] -);``` +); +``` diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 768878ac..2464d9fa 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -20,4 +20,5 @@ $result = $messaging->createAPNSProvider( bundleId: '', // optional sandbox: false, // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index bde1bb59..cd03c685 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -24,4 +24,5 @@ $result = $messaging->createEmail( draft: false, // optional html: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 1ab3e983..8ff6b217 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -16,4 +16,5 @@ $result = $messaging->createFCMProvider( name: '', serviceAccountJSON: [], // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index ca0a3cb1..9201f31a 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -22,4 +22,5 @@ $result = $messaging->createMailgunProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md index 78998cf5..212f6b23 100644 --- a/docs/examples/messaging/create-msg-91-provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -18,4 +18,5 @@ $result = $messaging->createMsg91Provider( senderId: '', // optional authKey: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 7efef532..82d1e2db 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -32,4 +32,5 @@ $result = $messaging->createPush( contentAvailable: false, // optional critical: false, // optional priority: MessagePriority::NORMAL() // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md index e32ad9fc..9892a9ce 100644 --- a/docs/examples/messaging/create-resend-provider.md +++ b/docs/examples/messaging/create-resend-provider.md @@ -20,4 +20,5 @@ $result = $messaging->createResendProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 38f213c4..30c08aef 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -20,4 +20,5 @@ $result = $messaging->createSendgridProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-ses-provider.md b/docs/examples/messaging/create-ses-provider.md index a9ec11c0..183b3734 100644 --- a/docs/examples/messaging/create-ses-provider.md +++ b/docs/examples/messaging/create-ses-provider.md @@ -22,4 +22,5 @@ $result = $messaging->createSesProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 1f45876b..945775ba 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -19,4 +19,5 @@ $result = $messaging->createSMS( targets: [], // optional draft: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index a55fd0fc..0e19cf2e 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -27,4 +27,5 @@ $result = $messaging->createSMTPProvider( replyToName: '', // optional replyToEmail: 'email@example.com', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index f0d27831..f016b862 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -15,4 +15,5 @@ $result = $messaging->createSubscriber( topicId: '', subscriberId: '', targetId: '' -);``` +); +``` diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 005e6d03..4f05f898 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -18,4 +18,5 @@ $result = $messaging->createTelesignProvider( customerId: '', // optional apiKey: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 262a9e2a..7c60a96f 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -18,4 +18,5 @@ $result = $messaging->createTextmagicProvider( username: '', // optional apiKey: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 460168e4..eca6d541 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -15,4 +15,5 @@ $result = $messaging->createTopic( topicId: '', name: '', subscribe: ["any"] // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index f8ee4175..568d28d9 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -18,4 +18,5 @@ $result = $messaging->createTwilioProvider( accountSid: '', // optional authToken: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 450cf9c5..719835de 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -18,4 +18,5 @@ $result = $messaging->createVonageProvider( apiKey: '', // optional apiSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index e0a63c15..c6849300 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -13,4 +13,5 @@ $messaging = new Messaging($client); $result = $messaging->deleteProvider( providerId: '' -);``` +); +``` diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 9720ad07..bef4fad1 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -14,4 +14,5 @@ $messaging = new Messaging($client); $result = $messaging->deleteSubscriber( topicId: '', subscriberId: '' -);``` +); +``` diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 90614515..353ae213 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -13,4 +13,5 @@ $messaging = new Messaging($client); $result = $messaging->deleteTopic( topicId: '' -);``` +); +``` diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 15489058..d1e07dd4 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -13,4 +13,5 @@ $messaging = new Messaging($client); $result = $messaging->delete( messageId: '' -);``` +); +``` diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index a1d2f026..19e98cab 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -13,4 +13,5 @@ $messaging = new Messaging($client); $result = $messaging->getMessage( messageId: '' -);``` +); +``` diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 6353e54f..c0b834ee 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -13,4 +13,5 @@ $messaging = new Messaging($client); $result = $messaging->getProvider( providerId: '' -);``` +); +``` diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index d3a20e95..9f6265bb 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -14,4 +14,5 @@ $messaging = new Messaging($client); $result = $messaging->getSubscriber( topicId: '', subscriberId: '' -);``` +); +``` diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 95ff3ff7..d048acb4 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -13,4 +13,5 @@ $messaging = new Messaging($client); $result = $messaging->getTopic( topicId: '' -);``` +); +``` diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index fa6d57c3..9bab16ef 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -15,4 +15,5 @@ $result = $messaging->listMessages( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 281a5220..1a2640f6 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -15,4 +15,5 @@ $result = $messaging->listProviders( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 096a8f2e..34e20a74 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -16,4 +16,5 @@ $result = $messaging->listSubscribers( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 0615d820..2fdcb93d 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -15,4 +15,5 @@ $result = $messaging->listTargets( messageId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 6386df17..d489bf44 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -15,4 +15,5 @@ $result = $messaging->listTopics( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index aa0e78f0..71708a8b 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -20,4 +20,5 @@ $result = $messaging->updateAPNSProvider( teamId: '', // optional bundleId: '', // optional sandbox: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 80918b1c..01884f13 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -24,4 +24,5 @@ $result = $messaging->updateEmail( bcc: [], // optional scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional attachments: [] // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index a9a54d1c..0bac7199 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -16,4 +16,5 @@ $result = $messaging->updateFCMProvider( name: '', // optional enabled: false, // optional serviceAccountJSON: [] // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 6392e78b..c32e95f3 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -22,4 +22,5 @@ $result = $messaging->updateMailgunProvider( fromEmail: 'email@example.com', // optional replyToName: '', // optional replyToEmail: '' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md index 67b689c9..0dce5035 100644 --- a/docs/examples/messaging/update-msg-91-provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -18,4 +18,5 @@ $result = $messaging->updateMsg91Provider( templateId: '', // optional senderId: '', // optional authKey: '' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 32cb1205..44406611 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -32,4 +32,5 @@ $result = $messaging->updatePush( contentAvailable: false, // optional critical: false, // optional priority: MessagePriority::NORMAL() // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md index ab60aaf3..50af4fd5 100644 --- a/docs/examples/messaging/update-resend-provider.md +++ b/docs/examples/messaging/update-resend-provider.md @@ -20,4 +20,5 @@ $result = $messaging->updateResendProvider( fromEmail: 'email@example.com', // optional replyToName: '', // optional replyToEmail: '' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index e6e0391a..f13f1ea5 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -20,4 +20,5 @@ $result = $messaging->updateSendgridProvider( fromEmail: 'email@example.com', // optional replyToName: '', // optional replyToEmail: '' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-ses-provider.md b/docs/examples/messaging/update-ses-provider.md index ee73b5cf..97008138 100644 --- a/docs/examples/messaging/update-ses-provider.md +++ b/docs/examples/messaging/update-ses-provider.md @@ -22,4 +22,5 @@ $result = $messaging->updateSesProvider( fromEmail: 'email@example.com', // optional replyToName: '', // optional replyToEmail: '' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index e59af27c..3cfd2580 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -19,4 +19,5 @@ $result = $messaging->updateSMS( content: '', // optional draft: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 73b4b3af..1c82f921 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -27,4 +27,5 @@ $result = $messaging->updateSMTPProvider( replyToName: '', // optional replyToEmail: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 33fcbb30..d8926768 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -18,4 +18,5 @@ $result = $messaging->updateTelesignProvider( customerId: '', // optional apiKey: '', // optional from: '' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 96564c70..16c4355b 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -18,4 +18,5 @@ $result = $messaging->updateTextmagicProvider( username: '', // optional apiKey: '', // optional from: '' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 257e7544..14877cc9 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -15,4 +15,5 @@ $result = $messaging->updateTopic( topicId: '', name: '', // optional subscribe: ["any"] // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index c9bcfa9b..35ec95d7 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -18,4 +18,5 @@ $result = $messaging->updateTwilioProvider( accountSid: '', // optional authToken: '', // optional from: '' // optional -);``` +); +``` diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 112745e7..a4d0f88a 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -18,4 +18,5 @@ $result = $messaging->updateVonageProvider( apiKey: '', // optional apiSecret: '', // optional from: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md index f3c77d1a..5540b110 100644 --- a/docs/examples/oauth2/approve.md +++ b/docs/examples/oauth2/approve.md @@ -15,4 +15,5 @@ $result = $oauth2->approve( grantId: '', authorizationDetails: '', // optional scope: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md index 8f2b1251..d7a465ad 100644 --- a/docs/examples/oauth2/authorize-post.md +++ b/docs/examples/oauth2/authorize-post.md @@ -26,4 +26,5 @@ $result = $oauth2->authorizePost( resource: '', // optional audience: '', // optional requestUri: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md index c0217125..ad373715 100644 --- a/docs/examples/oauth2/authorize.md +++ b/docs/examples/oauth2/authorize.md @@ -26,4 +26,5 @@ $result = $oauth2->authorize( resource: '', // optional audience: '', // optional requestUri: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md index 6da66a8b..00358d8a 100644 --- a/docs/examples/oauth2/create-device-authorization.md +++ b/docs/examples/oauth2/create-device-authorization.md @@ -17,4 +17,5 @@ $result = $oauth2->createDeviceAuthorization( authorizationDetails: '', // optional resource: '', // optional audience: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md index 598470f6..95467652 100644 --- a/docs/examples/oauth2/create-grant.md +++ b/docs/examples/oauth2/create-grant.md @@ -13,4 +13,5 @@ $oauth2 = new Oauth2($client); $result = $oauth2->createGrant( userCode: '' -);``` +); +``` diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md index ca770f1b..ddb3d7d6 100644 --- a/docs/examples/oauth2/create-par.md +++ b/docs/examples/oauth2/create-par.md @@ -25,4 +25,5 @@ $result = $oauth2->createPAR( authorizationDetails: '', // optional resource: '', // optional audience: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md index 61905d60..a4be2d6f 100644 --- a/docs/examples/oauth2/create-token.md +++ b/docs/examples/oauth2/create-token.md @@ -22,4 +22,5 @@ $result = $oauth2->createToken( redirectUri: 'https://example.com', // optional resource: '', // optional audience: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md index b4979828..a6469c30 100644 --- a/docs/examples/oauth2/get-grant.md +++ b/docs/examples/oauth2/get-grant.md @@ -13,4 +13,5 @@ $oauth2 = new Oauth2($client); $result = $oauth2->getGrant( grantId: '' -);``` +); +``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md index 1c2fb1c4..49c1f499 100644 --- a/docs/examples/oauth2/list-organizations.md +++ b/docs/examples/oauth2/list-organizations.md @@ -15,4 +15,5 @@ $result = $oauth2->listOrganizations( limit: 1, // optional offset: 0, // optional search: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md index ea4ff032..3bbcf901 100644 --- a/docs/examples/oauth2/list-projects.md +++ b/docs/examples/oauth2/list-projects.md @@ -15,4 +15,5 @@ $result = $oauth2->listProjects( limit: 1, // optional offset: 0, // optional search: '' // optional -);``` +); +``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md index 65deab84..bd98d721 100644 --- a/docs/examples/oauth2/reject.md +++ b/docs/examples/oauth2/reject.md @@ -13,4 +13,5 @@ $oauth2 = new Oauth2($client); $result = $oauth2->reject( grantId: '' -);``` +); +``` diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md index 97c7b861..7122ed7f 100644 --- a/docs/examples/oauth2/revoke.md +++ b/docs/examples/oauth2/revoke.md @@ -16,4 +16,5 @@ $result = $oauth2->revoke( tokenTypeHint: 'access_token', // optional clientId: '', // optional clientSecret: '' // optional -);``` +); +``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md index 51855c47..70a656e7 100644 --- a/docs/examples/organization/create-installation.md +++ b/docs/examples/organization/create-installation.md @@ -14,4 +14,5 @@ $organization = new Organization($client); $result = $organization->createInstallation( appId: '', authorizationDetails: '' // optional -);``` +); +``` diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-key.md index 67127ca3..c7cb7dde 100644 --- a/docs/examples/organization/create-key.md +++ b/docs/examples/organization/create-key.md @@ -17,4 +17,5 @@ $result = $organization->createKey( name: '', scopes: [OrganizationKeyScopes::PROJECTSREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); +``` diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md index 372c09cc..c0de51a8 100644 --- a/docs/examples/organization/create-membership.md +++ b/docs/examples/organization/create-membership.md @@ -18,4 +18,5 @@ $result = $organization->createMembership( phone: '+12065550100', // optional url: 'https://example.com', // optional name: '' // optional -);``` +); +``` diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md index ffb08c2e..32fdc6f8 100644 --- a/docs/examples/organization/create-project.md +++ b/docs/examples/organization/create-project.md @@ -16,4 +16,5 @@ $result = $organization->createProject( projectId: '', name: '', region: Region::FRA() // optional -);``` +); +``` diff --git a/docs/examples/organization/delete-installation.md b/docs/examples/organization/delete-installation.md index 23b8e692..c0eab5cd 100644 --- a/docs/examples/organization/delete-installation.md +++ b/docs/examples/organization/delete-installation.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->deleteInstallation( installationId: '' -);``` +); +``` diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/delete-key.md index 34a53d66..ca72f3dd 100644 --- a/docs/examples/organization/delete-key.md +++ b/docs/examples/organization/delete-key.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->deleteKey( keyId: '' -);``` +); +``` diff --git a/docs/examples/organization/delete-membership.md b/docs/examples/organization/delete-membership.md index 9da3b64f..86b73786 100644 --- a/docs/examples/organization/delete-membership.md +++ b/docs/examples/organization/delete-membership.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->deleteMembership( membershipId: '' -);``` +); +``` diff --git a/docs/examples/organization/delete-project.md b/docs/examples/organization/delete-project.md index 6900101a..3456ab77 100644 --- a/docs/examples/organization/delete-project.md +++ b/docs/examples/organization/delete-project.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->deleteProject( projectId: '' -);``` +); +``` diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md index 5e4b6763..fea4b673 100644 --- a/docs/examples/organization/get-installation.md +++ b/docs/examples/organization/get-installation.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->getInstallation( installationId: '' -);``` +); +``` diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/get-key.md index 165b5663..bf651e9e 100644 --- a/docs/examples/organization/get-key.md +++ b/docs/examples/organization/get-key.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->getKey( keyId: '' -);``` +); +``` diff --git a/docs/examples/organization/get-membership.md b/docs/examples/organization/get-membership.md index 52e2d17d..bb5802ca 100644 --- a/docs/examples/organization/get-membership.md +++ b/docs/examples/organization/get-membership.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->getMembership( membershipId: '' -);``` +); +``` diff --git a/docs/examples/organization/get-project.md b/docs/examples/organization/get-project.md index 27a101da..97fe8c37 100644 --- a/docs/examples/organization/get-project.md +++ b/docs/examples/organization/get-project.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->getProject( projectId: '' -);``` +); +``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md index 170243d3..016988c3 100644 --- a/docs/examples/organization/list-installations.md +++ b/docs/examples/organization/list-installations.md @@ -14,4 +14,5 @@ $organization = new Organization($client); $result = $organization->listInstallations( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-keys.md index 7cc16f01..dbe27502 100644 --- a/docs/examples/organization/list-keys.md +++ b/docs/examples/organization/list-keys.md @@ -14,4 +14,5 @@ $organization = new Organization($client); $result = $organization->listKeys( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/organization/list-memberships.md b/docs/examples/organization/list-memberships.md index 17858996..fa76eb4d 100644 --- a/docs/examples/organization/list-memberships.md +++ b/docs/examples/organization/list-memberships.md @@ -15,4 +15,5 @@ $result = $organization->listMemberships( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/organization/list-projects.md b/docs/examples/organization/list-projects.md index 5fafb599..d44084b8 100644 --- a/docs/examples/organization/list-projects.md +++ b/docs/examples/organization/list-projects.md @@ -15,4 +15,5 @@ $result = $organization->listProjects( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md index a35f797e..af6cf57b 100644 --- a/docs/examples/organization/update-installation.md +++ b/docs/examples/organization/update-installation.md @@ -14,4 +14,5 @@ $organization = new Organization($client); $result = $organization->updateInstallation( installationId: '', authorizationDetails: '' // optional -);``` +); +``` diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-key.md index 1187df49..575e6119 100644 --- a/docs/examples/organization/update-key.md +++ b/docs/examples/organization/update-key.md @@ -17,4 +17,5 @@ $result = $organization->updateKey( name: '', scopes: [OrganizationKeyScopes::PROJECTSREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); +``` diff --git a/docs/examples/organization/update-membership.md b/docs/examples/organization/update-membership.md index 7097729e..63994a9f 100644 --- a/docs/examples/organization/update-membership.md +++ b/docs/examples/organization/update-membership.md @@ -14,4 +14,5 @@ $organization = new Organization($client); $result = $organization->updateMembership( membershipId: '', roles: [] -);``` +); +``` diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md index 45f1ee4b..577fe9f8 100644 --- a/docs/examples/organization/update-project.md +++ b/docs/examples/organization/update-project.md @@ -14,4 +14,5 @@ $organization = new Organization($client); $result = $organization->updateProject( projectId: '', name: '' -);``` +); +``` diff --git a/docs/examples/organization/update.md b/docs/examples/organization/update.md index 45e7f0ff..1c2ccac4 100644 --- a/docs/examples/organization/update.md +++ b/docs/examples/organization/update.md @@ -13,4 +13,5 @@ $organization = new Organization($client); $result = $organization->update( name: '' -);``` +); +``` diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md index 225ee6ca..c303ca79 100644 --- a/docs/examples/presences/delete.md +++ b/docs/examples/presences/delete.md @@ -13,4 +13,5 @@ $presences = new Presences($client); $result = $presences->delete( presenceId: '' -);``` +); +``` diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md index c0196986..24619c6e 100644 --- a/docs/examples/presences/get.md +++ b/docs/examples/presences/get.md @@ -13,4 +13,5 @@ $presences = new Presences($client); $result = $presences->get( presenceId: '' -);``` +); +``` diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md index 61620297..5fb17b99 100644 --- a/docs/examples/presences/list.md +++ b/docs/examples/presences/list.md @@ -15,4 +15,5 @@ $result = $presences->list( queries: [], // optional total: false, // optional ttl: 0 // optional -);``` +); +``` diff --git a/docs/examples/presences/update.md b/docs/examples/presences/update.md index 95912f0f..dc05bcfe 100644 --- a/docs/examples/presences/update.md +++ b/docs/examples/presences/update.md @@ -21,4 +21,5 @@ $result = $presences->update( metadata: [], // optional permissions: [Permission::read(Role::any())], // optional purge: false // optional -);``` +); +``` diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md index f6d34e2e..df2e58dc 100644 --- a/docs/examples/presences/upsert.md +++ b/docs/examples/presences/upsert.md @@ -20,4 +20,5 @@ $result = $presences->upsert( permissions: [Permission::read(Role::any())], // optional expiresAt: '2020-10-15T06:38:00.000+00:00', // optional metadata: [] // optional -);``` +); +``` diff --git a/docs/examples/project/create-android-platform.md b/docs/examples/project/create-android-platform.md index 491a36f3..ae1df197 100644 --- a/docs/examples/project/create-android-platform.md +++ b/docs/examples/project/create-android-platform.md @@ -15,4 +15,5 @@ $result = $project->createAndroidPlatform( platformId: '', name: '', applicationId: '' -);``` +); +``` diff --git a/docs/examples/project/create-apple-platform.md b/docs/examples/project/create-apple-platform.md index 38487ce9..6b2bbd24 100644 --- a/docs/examples/project/create-apple-platform.md +++ b/docs/examples/project/create-apple-platform.md @@ -15,4 +15,5 @@ $result = $project->createApplePlatform( platformId: '', name: '', bundleIdentifier: '' -);``` +); +``` diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md index 29a813a7..224dc841 100644 --- a/docs/examples/project/create-ephemeral-key.md +++ b/docs/examples/project/create-ephemeral-key.md @@ -15,4 +15,5 @@ $project = new Project($client); $result = $project->createEphemeralKey( scopes: [ProjectKeyScopes::PROJECTREAD()], duration: 600 -);``` +); +``` diff --git a/docs/examples/project/create-linux-platform.md b/docs/examples/project/create-linux-platform.md index ff21b34d..e7ea4295 100644 --- a/docs/examples/project/create-linux-platform.md +++ b/docs/examples/project/create-linux-platform.md @@ -15,4 +15,5 @@ $result = $project->createLinuxPlatform( platformId: '', name: '', packageName: '' -);``` +); +``` diff --git a/docs/examples/project/create-mock-phone.md b/docs/examples/project/create-mock-phone.md index 6d73a0b4..87da696c 100644 --- a/docs/examples/project/create-mock-phone.md +++ b/docs/examples/project/create-mock-phone.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->createMockPhone( number: '+12065550100', otp: '' -);``` +); +``` diff --git a/docs/examples/project/create-smtp-test.md b/docs/examples/project/create-smtp-test.md index 98cb7edd..a16026a8 100644 --- a/docs/examples/project/create-smtp-test.md +++ b/docs/examples/project/create-smtp-test.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->createSMTPTest( emails: [] -);``` +); +``` diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index 9f6d65e0..b2471e59 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -13,7 +13,8 @@ $project = new Project($client); $result = $project->createVariable( variableId: '', - key: '', + key: '', value: '', secret: false // optional -);``` +); +``` diff --git a/docs/examples/project/create-web-platform.md b/docs/examples/project/create-web-platform.md index 932e10e9..dc1f7e81 100644 --- a/docs/examples/project/create-web-platform.md +++ b/docs/examples/project/create-web-platform.md @@ -15,4 +15,5 @@ $result = $project->createWebPlatform( platformId: '', name: '', hostname: 'app.example.com' -);``` +); +``` diff --git a/docs/examples/project/create-windows-platform.md b/docs/examples/project/create-windows-platform.md index 9a6f1757..c9dd6500 100644 --- a/docs/examples/project/create-windows-platform.md +++ b/docs/examples/project/create-windows-platform.md @@ -15,4 +15,5 @@ $result = $project->createWindowsPlatform( platformId: '', name: '', packageIdentifierName: '' -);``` +); +``` diff --git a/docs/examples/project/delete-key.md b/docs/examples/project/delete-key.md index 5e90c2e9..b964e9d1 100644 --- a/docs/examples/project/delete-key.md +++ b/docs/examples/project/delete-key.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->deleteKey( keyId: '' -);``` +); +``` diff --git a/docs/examples/project/delete-mock-phone.md b/docs/examples/project/delete-mock-phone.md index 6cdfcc1c..c800757f 100644 --- a/docs/examples/project/delete-mock-phone.md +++ b/docs/examples/project/delete-mock-phone.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->deleteMockPhone( number: '+12065550100' -);``` +); +``` diff --git a/docs/examples/project/delete-platform.md b/docs/examples/project/delete-platform.md index ca537aa2..9171a0bd 100644 --- a/docs/examples/project/delete-platform.md +++ b/docs/examples/project/delete-platform.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->deletePlatform( platformId: '' -);``` +); +``` diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md index a6fb65a4..988ff801 100644 --- a/docs/examples/project/delete-variable.md +++ b/docs/examples/project/delete-variable.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->deleteVariable( variableId: '' -);``` +); +``` diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md index f06e1c3b..87df1a1c 100644 --- a/docs/examples/project/get-email-template.md +++ b/docs/examples/project/get-email-template.md @@ -16,4 +16,5 @@ $project = new Project($client); $result = $project->getEmailTemplate( templateId: ProjectEmailTemplateId::VERIFICATION(), locale: ProjectEmailTemplateLocale::AF() // optional -);``` +); +``` diff --git a/docs/examples/project/get-key.md b/docs/examples/project/get-key.md index 8e8ba5e5..45a87d10 100644 --- a/docs/examples/project/get-key.md +++ b/docs/examples/project/get-key.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->getKey( keyId: '' -);``` +); +``` diff --git a/docs/examples/project/get-mock-phone.md b/docs/examples/project/get-mock-phone.md index 512d64c4..e9a69c28 100644 --- a/docs/examples/project/get-mock-phone.md +++ b/docs/examples/project/get-mock-phone.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->getMockPhone( number: '+12065550100' -);``` +); +``` diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md index ded92e19..718e0e37 100644 --- a/docs/examples/project/get-o-auth-2-provider.md +++ b/docs/examples/project/get-o-auth-2-provider.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->getOAuth2Provider( providerId: ProjectOAuthProviderId::AMAZON() -);``` +); +``` diff --git a/docs/examples/project/get-platform.md b/docs/examples/project/get-platform.md index 3e783acb..e99c8dea 100644 --- a/docs/examples/project/get-platform.md +++ b/docs/examples/project/get-platform.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->getPlatform( platformId: '' -);``` +); +``` diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md index 5f60c812..d629ac72 100644 --- a/docs/examples/project/get-policy.md +++ b/docs/examples/project/get-policy.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->getPolicy( policyId: ProjectPolicyId::PASSWORDDICTIONARY() -);``` +); +``` diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index f80cd3ba..5d47cefe 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->getVariable( variableId: '' -);``` +); +``` diff --git a/docs/examples/project/list-email-templates.md b/docs/examples/project/list-email-templates.md index 47c65c4d..6887b8bd 100644 --- a/docs/examples/project/list-email-templates.md +++ b/docs/examples/project/list-email-templates.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->listEmailTemplates( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/project/list-keys.md b/docs/examples/project/list-keys.md index 0d1dbffd..1430acd7 100644 --- a/docs/examples/project/list-keys.md +++ b/docs/examples/project/list-keys.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->listKeys( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/project/list-mock-phones.md b/docs/examples/project/list-mock-phones.md index 5ca11c28..7c49e842 100644 --- a/docs/examples/project/list-mock-phones.md +++ b/docs/examples/project/list-mock-phones.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->listMockPhones( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/project/list-o-auth-2-providers.md b/docs/examples/project/list-o-auth-2-providers.md index 5f661d4b..2cfec075 100644 --- a/docs/examples/project/list-o-auth-2-providers.md +++ b/docs/examples/project/list-o-auth-2-providers.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->listOAuth2Providers( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/project/list-platforms.md b/docs/examples/project/list-platforms.md index 596d6280..f5b1bbdd 100644 --- a/docs/examples/project/list-platforms.md +++ b/docs/examples/project/list-platforms.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->listPlatforms( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/project/list-policies.md b/docs/examples/project/list-policies.md index 59d49f3e..2b8ffd33 100644 --- a/docs/examples/project/list-policies.md +++ b/docs/examples/project/list-policies.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->listPolicies( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index f6a9bb4f..8cce3662 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->listVariables( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-android-platform.md b/docs/examples/project/update-android-platform.md index 43df5075..1898911d 100644 --- a/docs/examples/project/update-android-platform.md +++ b/docs/examples/project/update-android-platform.md @@ -15,4 +15,5 @@ $result = $project->updateAndroidPlatform( platformId: '', name: '', applicationId: '' -);``` +); +``` diff --git a/docs/examples/project/update-apple-platform.md b/docs/examples/project/update-apple-platform.md index 2aa4f294..ec7f3245 100644 --- a/docs/examples/project/update-apple-platform.md +++ b/docs/examples/project/update-apple-platform.md @@ -15,4 +15,5 @@ $result = $project->updateApplePlatform( platformId: '', name: '', bundleIdentifier: '' -);``` +); +``` diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md index 3633f132..006f40f3 100644 --- a/docs/examples/project/update-auth-method.md +++ b/docs/examples/project/update-auth-method.md @@ -15,4 +15,5 @@ $project = new Project($client); $result = $project->updateAuthMethod( methodId: ProjectAuthMethodId::EMAILPASSWORD(), enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-deny-aliased-email-policy.md b/docs/examples/project/update-deny-aliased-email-policy.md index 3ddc159e..c54022b9 100644 --- a/docs/examples/project/update-deny-aliased-email-policy.md +++ b/docs/examples/project/update-deny-aliased-email-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateDenyAliasedEmailPolicy( enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-deny-corporate-email-policy.md b/docs/examples/project/update-deny-corporate-email-policy.md index 69ed3907..d702cc35 100644 --- a/docs/examples/project/update-deny-corporate-email-policy.md +++ b/docs/examples/project/update-deny-corporate-email-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateDenyCorporateEmailPolicy( enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-deny-disposable-email-policy.md b/docs/examples/project/update-deny-disposable-email-policy.md index 6733b205..52698e38 100644 --- a/docs/examples/project/update-deny-disposable-email-policy.md +++ b/docs/examples/project/update-deny-disposable-email-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateDenyDisposableEmailPolicy( enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-deny-free-email-policy.md b/docs/examples/project/update-deny-free-email-policy.md index 1b8d30f0..98419586 100644 --- a/docs/examples/project/update-deny-free-email-policy.md +++ b/docs/examples/project/update-deny-free-email-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateDenyFreeEmailPolicy( enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-email-template.md b/docs/examples/project/update-email-template.md index ac927772..2659fb13 100644 --- a/docs/examples/project/update-email-template.md +++ b/docs/examples/project/update-email-template.md @@ -22,4 +22,5 @@ $result = $project->updateEmailTemplate( senderEmail: 'email@example.com', // optional replyToEmail: 'email@example.com', // optional replyToName: '' // optional -);``` +); +``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index 1a1e1002..db883945 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -17,4 +17,5 @@ $result = $project->updateKey( name: '', scopes: [ProjectKeyScopes::PROJECTREAD()], expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); +``` diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md index 1c2897ed..aace3165 100644 --- a/docs/examples/project/update-labels.md +++ b/docs/examples/project/update-labels.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateLabels( labels: [] -);``` +); +``` diff --git a/docs/examples/project/update-linux-platform.md b/docs/examples/project/update-linux-platform.md index b05cbfaa..1e1cb5f9 100644 --- a/docs/examples/project/update-linux-platform.md +++ b/docs/examples/project/update-linux-platform.md @@ -15,4 +15,5 @@ $result = $project->updateLinuxPlatform( platformId: '', name: '', packageName: '' -);``` +); +``` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index c41ce611..145d3167 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -18,4 +18,5 @@ $result = $project->updateMembershipPrivacyPolicy( userName: false, // optional userMFA: false, // optional userAccessedAt: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-mfa-factors-policy.md b/docs/examples/project/update-mfa-factors-policy.md index 8823cc8f..c0eb035d 100644 --- a/docs/examples/project/update-mfa-factors-policy.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -16,4 +16,5 @@ $result = $project->updateMFAFactorsPolicy( email: false, // optional phone: false, // optional custom: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-mock-phone.md b/docs/examples/project/update-mock-phone.md index f157343f..7befe9a8 100644 --- a/docs/examples/project/update-mock-phone.md +++ b/docs/examples/project/update-mock-phone.md @@ -14,4 +14,5 @@ $project = new Project($client); $result = $project->updateMockPhone( number: '+12065550100', otp: '' -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-amazon.md b/docs/examples/project/update-o-auth-2-amazon.md index 8a473860..f73c85e4 100644 --- a/docs/examples/project/update-o-auth-2-amazon.md +++ b/docs/examples/project/update-o-auth-2-amazon.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Amazon( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md index 3f4516c3..f742927c 100644 --- a/docs/examples/project/update-o-auth-2-apple.md +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -17,4 +17,5 @@ $result = $project->updateOAuth2Apple( teamId: '', // optional p8File: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-appwrite.md b/docs/examples/project/update-o-auth-2-appwrite.md index be24abdb..bf5252d4 100644 --- a/docs/examples/project/update-o-auth-2-appwrite.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Appwrite( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-auth-0.md b/docs/examples/project/update-o-auth-2-auth-0.md index d9f17f78..b80b4b15 100644 --- a/docs/examples/project/update-o-auth-2-auth-0.md +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -16,4 +16,5 @@ $result = $project->updateOAuth2Auth0( clientSecret: '', // optional endpoint: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-authentik.md b/docs/examples/project/update-o-auth-2-authentik.md index b5c7e27e..0a6c66ac 100644 --- a/docs/examples/project/update-o-auth-2-authentik.md +++ b/docs/examples/project/update-o-auth-2-authentik.md @@ -16,4 +16,5 @@ $result = $project->updateOAuth2Authentik( clientSecret: '', // optional endpoint: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-autodesk.md b/docs/examples/project/update-o-auth-2-autodesk.md index e85b9bb9..8c3eba87 100644 --- a/docs/examples/project/update-o-auth-2-autodesk.md +++ b/docs/examples/project/update-o-auth-2-autodesk.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Autodesk( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-bitbucket.md b/docs/examples/project/update-o-auth-2-bitbucket.md index 4985215c..d33326ec 100644 --- a/docs/examples/project/update-o-auth-2-bitbucket.md +++ b/docs/examples/project/update-o-auth-2-bitbucket.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Bitbucket( key: '', // optional secret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-bitly.md b/docs/examples/project/update-o-auth-2-bitly.md index b8c00ecd..40de4667 100644 --- a/docs/examples/project/update-o-auth-2-bitly.md +++ b/docs/examples/project/update-o-auth-2-bitly.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Bitly( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-box.md b/docs/examples/project/update-o-auth-2-box.md index ba88f561..55149987 100644 --- a/docs/examples/project/update-o-auth-2-box.md +++ b/docs/examples/project/update-o-auth-2-box.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Box( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-dailymotion.md b/docs/examples/project/update-o-auth-2-dailymotion.md index 44634caa..112a7301 100644 --- a/docs/examples/project/update-o-auth-2-dailymotion.md +++ b/docs/examples/project/update-o-auth-2-dailymotion.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Dailymotion( apiKey: '', // optional apiSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-discord.md b/docs/examples/project/update-o-auth-2-discord.md index d323c92d..9a0b1616 100644 --- a/docs/examples/project/update-o-auth-2-discord.md +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Discord( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-disqus.md b/docs/examples/project/update-o-auth-2-disqus.md index 30281862..ffc8e735 100644 --- a/docs/examples/project/update-o-auth-2-disqus.md +++ b/docs/examples/project/update-o-auth-2-disqus.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Disqus( publicKey: '', // optional secretKey: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-dropbox.md b/docs/examples/project/update-o-auth-2-dropbox.md index 59575cdc..982c6f3d 100644 --- a/docs/examples/project/update-o-auth-2-dropbox.md +++ b/docs/examples/project/update-o-auth-2-dropbox.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Dropbox( appKey: '', // optional appSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-etsy.md b/docs/examples/project/update-o-auth-2-etsy.md index 19aab961..01c45f24 100644 --- a/docs/examples/project/update-o-auth-2-etsy.md +++ b/docs/examples/project/update-o-auth-2-etsy.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Etsy( keyString: '', // optional sharedSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-facebook.md b/docs/examples/project/update-o-auth-2-facebook.md index 8f76d065..0545945a 100644 --- a/docs/examples/project/update-o-auth-2-facebook.md +++ b/docs/examples/project/update-o-auth-2-facebook.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Facebook( appId: '', // optional appSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-figma.md b/docs/examples/project/update-o-auth-2-figma.md index 71d36ebf..420ebc06 100644 --- a/docs/examples/project/update-o-auth-2-figma.md +++ b/docs/examples/project/update-o-auth-2-figma.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Figma( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-fusion-auth.md b/docs/examples/project/update-o-auth-2-fusion-auth.md index 0b3709b2..bc8e7205 100644 --- a/docs/examples/project/update-o-auth-2-fusion-auth.md +++ b/docs/examples/project/update-o-auth-2-fusion-auth.md @@ -16,4 +16,5 @@ $result = $project->updateOAuth2FusionAuth( clientSecret: '', // optional endpoint: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-git-hub.md b/docs/examples/project/update-o-auth-2-git-hub.md index 62871aa6..92dc5726 100644 --- a/docs/examples/project/update-o-auth-2-git-hub.md +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2GitHub( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-gitlab.md b/docs/examples/project/update-o-auth-2-gitlab.md index 2532af0c..485d05f1 100644 --- a/docs/examples/project/update-o-auth-2-gitlab.md +++ b/docs/examples/project/update-o-auth-2-gitlab.md @@ -16,4 +16,5 @@ $result = $project->updateOAuth2Gitlab( secret: '', // optional endpoint: 'https://example.com', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md index 63466c43..28137e9a 100644 --- a/docs/examples/project/update-o-auth-2-google.md +++ b/docs/examples/project/update-o-auth-2-google.md @@ -17,4 +17,5 @@ $result = $project->updateOAuth2Google( clientSecret: '', // optional prompt: [ProjectOAuth2GooglePrompt::NONE()], // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-hugging-face.md b/docs/examples/project/update-o-auth-2-hugging-face.md new file mode 100644 index 00000000..c42599ab --- /dev/null +++ b/docs/examples/project/update-o-auth-2-hugging-face.md @@ -0,0 +1,19 @@ +```php +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$project = new Project($client); + +$result = $project->updateOAuth2HuggingFace( + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional +); +``` diff --git a/docs/examples/project/update-o-auth-2-keycloak.md b/docs/examples/project/update-o-auth-2-keycloak.md index 3604e4b6..19d9b9b2 100644 --- a/docs/examples/project/update-o-auth-2-keycloak.md +++ b/docs/examples/project/update-o-auth-2-keycloak.md @@ -17,4 +17,5 @@ $result = $project->updateOAuth2Keycloak( endpoint: '', // optional realmName: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-kick.md b/docs/examples/project/update-o-auth-2-kick.md index 02c876fc..39aba891 100644 --- a/docs/examples/project/update-o-auth-2-kick.md +++ b/docs/examples/project/update-o-auth-2-kick.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Kick( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-linkedin.md b/docs/examples/project/update-o-auth-2-linkedin.md index 06451e14..f80ea7a4 100644 --- a/docs/examples/project/update-o-auth-2-linkedin.md +++ b/docs/examples/project/update-o-auth-2-linkedin.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Linkedin( clientId: '', // optional primaryClientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-microsoft.md b/docs/examples/project/update-o-auth-2-microsoft.md index f5a0af73..349bf932 100644 --- a/docs/examples/project/update-o-auth-2-microsoft.md +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -16,4 +16,5 @@ $result = $project->updateOAuth2Microsoft( applicationSecret: '', // optional tenant: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-notion.md b/docs/examples/project/update-o-auth-2-notion.md index abf0b430..d4de282b 100644 --- a/docs/examples/project/update-o-auth-2-notion.md +++ b/docs/examples/project/update-o-auth-2-notion.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Notion( oauthClientId: '', // optional oauthClientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md index 2c06fe89..f3b1b8a0 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -22,4 +22,5 @@ $result = $project->updateOAuth2Oidc( prompt: [ProjectOAuth2OidcPrompt::NONE()], // optional maxAge: 0, // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md index 4de41d22..9f8df039 100644 --- a/docs/examples/project/update-o-auth-2-okta.md +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -17,4 +17,5 @@ $result = $project->updateOAuth2Okta( domain: '', // optional authorizationServerId: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-paypal-sandbox.md b/docs/examples/project/update-o-auth-2-paypal-sandbox.md index 5cb43b6d..c6e4096f 100644 --- a/docs/examples/project/update-o-auth-2-paypal-sandbox.md +++ b/docs/examples/project/update-o-auth-2-paypal-sandbox.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2PaypalSandbox( clientId: '', // optional secretKey: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-paypal.md b/docs/examples/project/update-o-auth-2-paypal.md index 51e8935f..bab2e8c4 100644 --- a/docs/examples/project/update-o-auth-2-paypal.md +++ b/docs/examples/project/update-o-auth-2-paypal.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Paypal( clientId: '', // optional secretKey: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-podio.md b/docs/examples/project/update-o-auth-2-podio.md index 1c607660..411269c6 100644 --- a/docs/examples/project/update-o-auth-2-podio.md +++ b/docs/examples/project/update-o-auth-2-podio.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Podio( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-salesforce.md b/docs/examples/project/update-o-auth-2-salesforce.md index 8e0ab044..1247627c 100644 --- a/docs/examples/project/update-o-auth-2-salesforce.md +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Salesforce( customerKey: '', // optional customerSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 1d06279a..08a2c921 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -28,4 +28,5 @@ $result = $project->updateOAuth2Server( deviceCodeDuration: 60, // optional defaultScopes: [], // optional installationScopes: [] // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-slack.md b/docs/examples/project/update-o-auth-2-slack.md index 858113c8..0f07f22a 100644 --- a/docs/examples/project/update-o-auth-2-slack.md +++ b/docs/examples/project/update-o-auth-2-slack.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Slack( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-spotify.md b/docs/examples/project/update-o-auth-2-spotify.md index 44f22c33..08e7e89d 100644 --- a/docs/examples/project/update-o-auth-2-spotify.md +++ b/docs/examples/project/update-o-auth-2-spotify.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Spotify( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-stripe.md b/docs/examples/project/update-o-auth-2-stripe.md index 9b2276c6..975f3925 100644 --- a/docs/examples/project/update-o-auth-2-stripe.md +++ b/docs/examples/project/update-o-auth-2-stripe.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Stripe( clientId: '', // optional apiSecretKey: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md index 24777704..74e32d31 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md +++ b/docs/examples/project/update-o-auth-2-tradeshift-sandbox.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2TradeshiftSandbox( oauth2ClientId: '', // optional oauth2ClientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-tradeshift.md b/docs/examples/project/update-o-auth-2-tradeshift.md index 72177e62..a9431d32 100644 --- a/docs/examples/project/update-o-auth-2-tradeshift.md +++ b/docs/examples/project/update-o-auth-2-tradeshift.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Tradeshift( oauth2ClientId: '', // optional oauth2ClientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-twitch.md b/docs/examples/project/update-o-auth-2-twitch.md index a3cf258d..0e66fc0e 100644 --- a/docs/examples/project/update-o-auth-2-twitch.md +++ b/docs/examples/project/update-o-auth-2-twitch.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Twitch( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-word-press.md b/docs/examples/project/update-o-auth-2-word-press.md index 3380007c..77469fa1 100644 --- a/docs/examples/project/update-o-auth-2-word-press.md +++ b/docs/examples/project/update-o-auth-2-word-press.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2WordPress( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-yahoo.md b/docs/examples/project/update-o-auth-2-yahoo.md index 588c9926..379bb055 100644 --- a/docs/examples/project/update-o-auth-2-yahoo.md +++ b/docs/examples/project/update-o-auth-2-yahoo.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Yahoo( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-yandex.md b/docs/examples/project/update-o-auth-2-yandex.md index c1e5b24d..f756b100 100644 --- a/docs/examples/project/update-o-auth-2-yandex.md +++ b/docs/examples/project/update-o-auth-2-yandex.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Yandex( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-zoho.md b/docs/examples/project/update-o-auth-2-zoho.md index 08a9b1e1..624b7f4f 100644 --- a/docs/examples/project/update-o-auth-2-zoho.md +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Zoho( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2-zoom.md b/docs/examples/project/update-o-auth-2-zoom.md index e30af5ba..655a5482 100644 --- a/docs/examples/project/update-o-auth-2-zoom.md +++ b/docs/examples/project/update-o-auth-2-zoom.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2Zoom( clientId: '', // optional clientSecret: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-o-auth-2x.md b/docs/examples/project/update-o-auth-2x.md index 86ee07f1..93f3ef31 100644 --- a/docs/examples/project/update-o-auth-2x.md +++ b/docs/examples/project/update-o-auth-2x.md @@ -15,4 +15,5 @@ $result = $project->updateOAuth2X( customerKey: '', // optional secretKey: '', // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md index 680edb5f..5a8da06f 100644 --- a/docs/examples/project/update-password-dictionary-policy.md +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updatePasswordDictionaryPolicy( enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-password-history-policy.md b/docs/examples/project/update-password-history-policy.md index 2fac6d7d..2d4c36ef 100644 --- a/docs/examples/project/update-password-history-policy.md +++ b/docs/examples/project/update-password-history-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updatePasswordHistoryPolicy( total: 1 -);``` +); +``` diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md index 6cce48c7..70cc79d1 100644 --- a/docs/examples/project/update-password-personal-data-policy.md +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updatePasswordPersonalDataPolicy( enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-password-strength-policy.md b/docs/examples/project/update-password-strength-policy.md index 9bc29daf..08ca290f 100644 --- a/docs/examples/project/update-password-strength-policy.md +++ b/docs/examples/project/update-password-strength-policy.md @@ -17,4 +17,5 @@ $result = $project->updatePasswordStrengthPolicy( lowercase: false, // optional number: false, // optional symbols: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-protocol.md b/docs/examples/project/update-protocol.md index e87fc30d..1b8a71f2 100644 --- a/docs/examples/project/update-protocol.md +++ b/docs/examples/project/update-protocol.md @@ -15,4 +15,5 @@ $project = new Project($client); $result = $project->updateProtocol( protocolId: ProjectProtocolId::REST(), enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-service.md b/docs/examples/project/update-service.md index 88e90eab..606dcca0 100644 --- a/docs/examples/project/update-service.md +++ b/docs/examples/project/update-service.md @@ -15,4 +15,5 @@ $project = new Project($client); $result = $project->updateService( serviceId: ProjectServiceId::ACCOUNT(), enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-session-alert-policy.md b/docs/examples/project/update-session-alert-policy.md index ac10696c..3973a5a9 100644 --- a/docs/examples/project/update-session-alert-policy.md +++ b/docs/examples/project/update-session-alert-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateSessionAlertPolicy( enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md index 882e2b2f..a6f29fc7 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateSessionDurationPolicy( duration: 60 -);``` +); +``` diff --git a/docs/examples/project/update-session-invalidation-policy.md b/docs/examples/project/update-session-invalidation-policy.md index fa744e57..57b9b4fb 100644 --- a/docs/examples/project/update-session-invalidation-policy.md +++ b/docs/examples/project/update-session-invalidation-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateSessionInvalidationPolicy( enabled: false -);``` +); +``` diff --git a/docs/examples/project/update-session-limit-policy.md b/docs/examples/project/update-session-limit-policy.md index f1bb2e20..5dbda419 100644 --- a/docs/examples/project/update-session-limit-policy.md +++ b/docs/examples/project/update-session-limit-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateSessionLimitPolicy( total: 1 -);``` +); +``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index 71a7b8f0..70996253 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -23,4 +23,5 @@ $result = $project->updateSMTP( replyToName: '', // optional secure: ProjectSMTPSecure::TLS(), // optional enabled: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index 0dc2f1f7..0c75e101 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -13,4 +13,5 @@ $project = new Project($client); $result = $project->updateUserLimitPolicy( total: 0 -);``` +); +``` diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 3e44129c..f127b215 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -13,7 +13,8 @@ $project = new Project($client); $result = $project->updateVariable( variableId: '', - key: '', // optional + key: '', // optional value: '', // optional secret: false // optional -);``` +); +``` diff --git a/docs/examples/project/update-web-platform.md b/docs/examples/project/update-web-platform.md index 213e96f7..5066fc6e 100644 --- a/docs/examples/project/update-web-platform.md +++ b/docs/examples/project/update-web-platform.md @@ -15,4 +15,5 @@ $result = $project->updateWebPlatform( platformId: '', name: '', hostname: 'app.example.com' -);``` +); +``` diff --git a/docs/examples/project/update-windows-platform.md b/docs/examples/project/update-windows-platform.md index 40c881dd..25e4f3e9 100644 --- a/docs/examples/project/update-windows-platform.md +++ b/docs/examples/project/update-windows-platform.md @@ -15,4 +15,5 @@ $result = $project->updateWindowsPlatform( platformId: '', name: '', packageIdentifierName: '' -);``` +); +``` diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md index 81d7813d..94a17074 100644 --- a/docs/examples/proxy/create-api-rule.md +++ b/docs/examples/proxy/create-api-rule.md @@ -13,4 +13,5 @@ $proxy = new Proxy($client); $result = $proxy->createAPIRule( domain: '' -);``` +); +``` diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md index 0bd403fa..df22f3cf 100644 --- a/docs/examples/proxy/create-function-rule.md +++ b/docs/examples/proxy/create-function-rule.md @@ -15,4 +15,5 @@ $result = $proxy->createFunctionRule( domain: '', functionId: '', branch: '' // optional -);``` +); +``` diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md index 00ae00ad..6dd8879e 100644 --- a/docs/examples/proxy/create-invalidation.md +++ b/docs/examples/proxy/create-invalidation.md @@ -16,4 +16,5 @@ $result = $proxy->createInvalidation( domain: '', type: InvalidationType::TAG(), reference: '' // optional -);``` +); +``` diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index 1c2bbc18..8e08e4de 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -19,4 +19,5 @@ $result = $proxy->createRedirectRule( statusCode: StatusCode::MOVEDPERMANENTLY(), resourceId: '', resourceType: ProxyResourceType::SITE() -);``` +); +``` diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md index e1f0f2da..9502404d 100644 --- a/docs/examples/proxy/create-site-rule.md +++ b/docs/examples/proxy/create-site-rule.md @@ -15,4 +15,5 @@ $result = $proxy->createSiteRule( domain: '', siteId: '', branch: '' // optional -);``` +); +``` diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md index 45c6c35d..34ab03d9 100644 --- a/docs/examples/proxy/delete-rule.md +++ b/docs/examples/proxy/delete-rule.md @@ -13,4 +13,5 @@ $proxy = new Proxy($client); $result = $proxy->deleteRule( ruleId: '' -);``` +); +``` diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index c6f4c693..dd2f2276 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -13,4 +13,5 @@ $proxy = new Proxy($client); $result = $proxy->getRule( ruleId: '' -);``` +); +``` diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index 53c1e1a0..4f357f44 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -14,4 +14,5 @@ $proxy = new Proxy($client); $result = $proxy->listRules( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/proxy/update-rule-status.md b/docs/examples/proxy/update-rule-status.md index 0640da6d..c6248740 100644 --- a/docs/examples/proxy/update-rule-status.md +++ b/docs/examples/proxy/update-rule-status.md @@ -13,4 +13,5 @@ $proxy = new Proxy($client); $result = $proxy->updateRuleStatus( ruleId: '' -);``` +); +``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index 536300d5..96bec4fd 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -19,4 +19,5 @@ $result = $sites->createDeployment( buildCommand: '', // optional outputDirectory: '', // optional activate: false // optional -);``` +); +``` diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index 97fb1f5d..52cb598d 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->createDuplicateDeployment( siteId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 05f039e7..5eb34f8d 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -20,4 +20,5 @@ $result = $sites->createTemplateDeployment( type: TemplateReferenceType::BRANCH(), reference: '', activate: false // optional -);``` +); +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 5cc10bf0..20983b68 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -14,7 +14,8 @@ $sites = new Sites($client); $result = $sites->createVariable( siteId: '', variableId: '', - key: '', + key: '', value: '', secret: false // optional -);``` +); +``` diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index d01747bc..3ffffd13 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -17,4 +17,5 @@ $result = $sites->createVcsDeployment( type: VCSReferenceType::BRANCH(), reference: '', activate: false // optional -);``` +); +``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index eab5f21c..a9c34485 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -6,6 +6,7 @@ use Appwrite\Services\Sites; use Appwrite\Enums\Framework; use Appwrite\Enums\BuildRuntime; use Appwrite\Enums\Adapter; +use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -37,5 +38,7 @@ $result = $sites->create( providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional - deploymentRetention: 0 // optional -);``` + deploymentRetention: 0, // optional + scopes: [ProjectKeyScopes::PROJECTREAD()] // optional +); +``` diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index 97bb976e..df06bd2c 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->deleteDeployment( siteId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index ed5b3c5b..67db0a86 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->deleteLog( siteId: '', logId: '' -);``` +); +``` diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index bdb2fbf5..b8d24cb1 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->deleteVariable( siteId: '', variableId: '' -);``` +); +``` diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index c2965d4e..8a37fe99 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -13,4 +13,5 @@ $sites = new Sites($client); $result = $sites->delete( siteId: '' -);``` +); +``` diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index bfa02f11..b37b45e1 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -17,4 +17,5 @@ $result = $sites->getDeploymentDownload( deploymentId: '', type: DeploymentDownloadType::SOURCE(), // optional token: '' // optional -);``` +); +``` diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index 91f83678..94138c06 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->getDeployment( siteId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index a781d20f..e5b561a0 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->getLog( siteId: '', logId: '' -);``` +); +``` diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 80b61eca..9ab1ec37 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->getVariable( siteId: '', variableId: '' -);``` +); +``` diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index c8f8c8e2..01319766 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -13,4 +13,5 @@ $sites = new Sites($client); $result = $sites->get( siteId: '' -);``` +); +``` diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 82cee298..450c2890 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -16,4 +16,5 @@ $result = $sites->listDeployments( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 5626bbb1..28f71df2 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -15,4 +15,5 @@ $result = $sites->listLogs( siteId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index 33bc0c59..3a6826ad 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -13,4 +13,5 @@ $sites = new Sites($client); $result = $sites->listSpecifications( type: 'runtimes' // optional -);``` +); +``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 7caa8a5e..047e609e 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -15,4 +15,5 @@ $result = $sites->listVariables( siteId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index 08c13146..0d01e813 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -15,4 +15,5 @@ $result = $sites->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 06ffc751..d511aa62 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->updateDeploymentStatus( siteId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index bdac54d4..ed1c580f 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -14,4 +14,5 @@ $sites = new Sites($client); $result = $sites->updateSiteDeployment( siteId: '', deploymentId: '' -);``` +); +``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index bbdd3d51..7d0e6691 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -14,7 +14,8 @@ $sites = new Sites($client); $result = $sites->updateVariable( siteId: '', variableId: '', - key: '', // optional + key: '', // optional value: '', // optional secret: false // optional -);``` +); +``` diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 907e0c6c..ec1f3603 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -6,6 +6,7 @@ use Appwrite\Services\Sites; use Appwrite\Enums\Framework; use Appwrite\Enums\BuildRuntime; use Appwrite\Enums\Adapter; +use Appwrite\Enums\ProjectKeyScopes; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -37,5 +38,7 @@ $result = $sites->update( providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional - deploymentRetention: 0 // optional -);``` + deploymentRetention: 0, // optional + scopes: [ProjectKeyScopes::PROJECTREAD()] // optional +); +``` diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index f00c2c7f..df878841 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -26,4 +26,5 @@ $result = $storage->createBucket( encryption: false, // optional antivirus: false, // optional transformations: false // optional -);``` +); +``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 19c38797..730b72cd 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -20,4 +20,5 @@ $result = $storage->createFile( file: InputFile::withPath('file.png'), permissions: [Permission::read(Role::any())], // optional folder: '' // optional -);``` +); +``` diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 737f4e1d..d3e49726 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -13,4 +13,5 @@ $storage = new Storage($client); $result = $storage->deleteBucket( bucketId: '' -);``` +); +``` diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index dd2c3a70..89478352 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -14,4 +14,5 @@ $storage = new Storage($client); $result = $storage->deleteFile( bucketId: '', fileId: '' -);``` +); +``` diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index f6449aec..6dbeac9c 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -13,4 +13,5 @@ $storage = new Storage($client); $result = $storage->getBucket( bucketId: '' -);``` +); +``` diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index f55376f0..58797f23 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -15,4 +15,5 @@ $result = $storage->getFileDownload( bucketId: '', fileId: '', token: '' // optional -);``` +); +``` diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 8964011b..57820b94 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -28,4 +28,5 @@ $result = $storage->getFilePreview( background: '', // optional output: ImageFormat::JPG(), // optional token: '' // optional -);``` +); +``` diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 6a729dc8..270cf900 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -15,4 +15,5 @@ $result = $storage->getFileView( bucketId: '', fileId: '', token: '' // optional -);``` +); +``` diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index b498b604..5d5a1914 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -14,4 +14,5 @@ $storage = new Storage($client); $result = $storage->getFile( bucketId: '', fileId: '' -);``` +); +``` diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 3b0d79d7..5bc0f307 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -15,4 +15,5 @@ $result = $storage->listBuckets( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 77e78cde..46718e2b 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -16,4 +16,5 @@ $result = $storage->listFiles( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index c14e75c3..5557ce89 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -26,4 +26,5 @@ $result = $storage->updateBucket( encryption: false, // optional antivirus: false, // optional transformations: false // optional -);``` +); +``` diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 1e40a492..05bcc65a 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -18,4 +18,5 @@ $result = $storage->updateFile( fileId: '', name: '', // optional permissions: [Permission::read(Role::any())] // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index 2833fdd6..e7e6b148 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -20,4 +20,5 @@ $result = $tablesDB->createBigIntColumn( max: null, // optional default: null, // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index b6032a39..a149438c 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->createBooleanColumn( required: false, default: false, // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 9e21e014..8139ba10 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->createDatetimeColumn( required: false, default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index f24aa050..1df1a06c 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->createEmailColumn( required: false, default: 'email@example.com', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 95157424..f79751d1 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->createEnumColumn( required: false, default: '', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-failover.md b/docs/examples/tablesdb/create-failover.md index fbd2837b..e23ce6e7 100644 --- a/docs/examples/tablesdb/create-failover.md +++ b/docs/examples/tablesdb/create-failover.md @@ -14,4 +14,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->createFailover( databaseId: '', targetReplicaId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index c83abba7..2f5b542e 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -20,4 +20,5 @@ $result = $tablesDB->createFloatColumn( max: null, // optional default: null, // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 3cd6b12d..78cddc7a 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -21,4 +21,5 @@ $result = $tablesDB->createIndex( columns: [], orders: [OrderBy::ASC()], // optional lengths: [] // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index a42c8710..e7bb5e9c 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -20,4 +20,5 @@ $result = $tablesDB->createIntegerColumn( max: null, // optional default: null, // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index f40fe61d..42c1ca4c 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->createIpColumn( required: false, default: '', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index c1d17b82..652ce3f9 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -17,4 +17,5 @@ $result = $tablesDB->createLineColumn( key: '', required: false, default: [[1, 2], [3, 4], [5, 6]] // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 2b536665..83a999f8 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->createLongtextColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index 0fbd9cab..e51d2e5c 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->createMediumtextColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md index 37f670fe..520d3047 100644 --- a/docs/examples/tablesdb/create-migration.md +++ b/docs/examples/tablesdb/create-migration.md @@ -15,4 +15,5 @@ $result = $tablesDB->createMigration( databaseId: '', specification: 's-1vcpu-1gb', autoCutover: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index 45ea4c92..e60cf34e 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -24,4 +24,5 @@ $result = $tablesDB->createOperations( } } ] // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index bde57bc3..03c8fb70 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -17,4 +17,5 @@ $result = $tablesDB->createPointColumn( key: '', required: false, default: [1, 2] // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index ee340f34..ee5f65f4 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -17,4 +17,5 @@ $result = $tablesDB->createPolygonColumn( key: '', required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 06dd6c0d..0e31aaca 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -22,4 +22,5 @@ $result = $tablesDB->createRelationshipColumn( key: '', // optional twoWayKey: '', // optional onDelete: RelationMutate::CASCADE() // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index fc253f2b..1af62007 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -26,4 +26,5 @@ $result = $tablesDB->createRow( ], permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 8c08fa57..6ae0f802 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -16,4 +16,5 @@ $result = $tablesDB->createRows( tableId: '', rows: [], transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index a4dd4dac..3235e0c2 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -20,4 +20,5 @@ $result = $tablesDB->createStringColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index fbe44767..e4d281b4 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -22,4 +22,5 @@ $result = $tablesDB->createTable( enabled: false, // optional columns: [], // optional indexes: [] // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index 8d283926..592433a9 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->createTextColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index 6664c084..022dc50c 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->createTransaction( ttl: 60 // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index ceb1dae6..e8044ac7 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->createUrlColumn( required: false, default: 'https://example.com', // optional array: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 2f931922..b3b557b0 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -20,4 +20,5 @@ $result = $tablesDB->createVarcharColumn( default: '', // optional array: false, // optional encrypt: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 7df1d49a..e0f7503f 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -18,4 +18,5 @@ $result = $tablesDB->create( specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/cutover-migration.md b/docs/examples/tablesdb/cutover-migration.md index 71a37d33..624449ea 100644 --- a/docs/examples/tablesdb/cutover-migration.md +++ b/docs/examples/tablesdb/cutover-migration.md @@ -14,4 +14,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->cutoverMigration( databaseId: '', migrationId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 0d01314a..57088a34 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->decrementRowColumn( value: null, // optional min: null, // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index 97cafced..77647302 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -15,4 +15,5 @@ $result = $tablesDB->deleteColumn( databaseId: '', tableId: '', key: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index abad8248..29fe9595 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -15,4 +15,5 @@ $result = $tablesDB->deleteIndex( databaseId: '', tableId: '', key: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/delete-migration.md b/docs/examples/tablesdb/delete-migration.md index 255d6aa8..e2ee36c2 100644 --- a/docs/examples/tablesdb/delete-migration.md +++ b/docs/examples/tablesdb/delete-migration.md @@ -14,4 +14,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->deleteMigration( databaseId: '', migrationId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index 05722a0c..164a4d23 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -16,4 +16,5 @@ $result = $tablesDB->deleteRow( tableId: '', rowId: '', transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index 934ea6b7..2b13b6c7 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -16,4 +16,5 @@ $result = $tablesDB->deleteRows( tableId: '', queries: [], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index acc711db..fd65a34f 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -14,4 +14,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->deleteTable( databaseId: '', tableId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/delete-transaction.md b/docs/examples/tablesdb/delete-transaction.md index 2b0c7ff8..0127259d 100644 --- a/docs/examples/tablesdb/delete-transaction.md +++ b/docs/examples/tablesdb/delete-transaction.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->deleteTransaction( transactionId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 1b2cc93a..279bcf5f 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->delete( databaseId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index 0be374fc..9151c4e2 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -15,4 +15,5 @@ $result = $tablesDB->getColumn( databaseId: '', tableId: '', key: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index 5e79e708..0e9834ab 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -15,4 +15,5 @@ $result = $tablesDB->getIndex( databaseId: '', tableId: '', key: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md index 88d922b1..317e3fb0 100644 --- a/docs/examples/tablesdb/get-migration.md +++ b/docs/examples/tablesdb/get-migration.md @@ -14,4 +14,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getMigration( databaseId: '', migrationId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/get-replicas.md b/docs/examples/tablesdb/get-replicas.md index 0bc85769..5b7f832d 100644 --- a/docs/examples/tablesdb/get-replicas.md +++ b/docs/examples/tablesdb/get-replicas.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getReplicas( databaseId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index f8871ffa..c0415a60 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -17,4 +17,5 @@ $result = $tablesDB->getRow( rowId: '', queries: [], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/get-status.md b/docs/examples/tablesdb/get-status.md index e7a227c5..bba69f9b 100644 --- a/docs/examples/tablesdb/get-status.md +++ b/docs/examples/tablesdb/get-status.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getStatus( databaseId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index 1bc01662..5a2415f4 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -14,4 +14,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getTable( databaseId: '', tableId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index fc4030f5..bbce444e 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->getTransaction( transactionId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index 5dde28d8..cc771eb6 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->get( databaseId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 5c6176ee..0bcbe119 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->incrementRowColumn( value: null, // optional max: null, // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 2ecf6542..8004a3a3 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -16,4 +16,5 @@ $result = $tablesDB->listColumns( tableId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 17428fe1..dd865c5b 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -16,4 +16,5 @@ $result = $tablesDB->listIndexes( tableId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md index 20c8485c..f78c820f 100644 --- a/docs/examples/tablesdb/list-migrations.md +++ b/docs/examples/tablesdb/list-migrations.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->listMigrations( databaseId: '' -);``` +); +``` diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md index 311b1464..9785761b 100644 --- a/docs/examples/tablesdb/list-operations.md +++ b/docs/examples/tablesdb/list-operations.md @@ -16,4 +16,5 @@ $result = $tablesDB->listOperations( status: 'running', // optional limit: 1, // optional offset: 0 // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index b70a7598..3d4bdfb9 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -18,4 +18,5 @@ $result = $tablesDB->listRows( transactionId: '', // optional total: false, // optional ttl: 0 // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index c74d5a15..e4c4134a 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -16,4 +16,5 @@ $result = $tablesDB->listTables( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index 58b31a64..90b698c5 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -13,4 +13,5 @@ $tablesDB = new TablesDB($client); $result = $tablesDB->listTransactions( queries: [] // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 77da5528..ec6ec046 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -15,4 +15,5 @@ $result = $tablesDB->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md index 1a317032..f606d031 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -20,4 +20,5 @@ $result = $tablesDB->updateBigIntColumn( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 8a7850fc..5aa0a76a 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateBooleanColumn( required: false, default: false, newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index 30ef56b8..62c812fc 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateDatetimeColumn( required: false, default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 8cd10d41..6587b10c 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateEmailColumn( required: false, default: 'email@example.com', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index 0dcf5747..cac25399 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->updateEnumColumn( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 68a90df3..08513191 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -20,4 +20,5 @@ $result = $tablesDB->updateFloatColumn( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index ba7a781f..5e595c5c 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -20,4 +20,5 @@ $result = $tablesDB->updateIntegerColumn( min: null, // optional max: null, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 25a71601..7a8a09a5 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateIpColumn( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index a7126a39..674e1ae2 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateLineColumn( required: false, default: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index aaccf927..460b7411 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateLongtextColumn( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 2b06e8d3..d4539282 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateMediumtextColumn( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 0d137cea..8b36739f 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updatePointColumn( required: false, default: [1, 2], // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 5341610c..67f91c37 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updatePolygonColumn( required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 4b153851..9c439185 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateRelationshipColumn( key: '', onDelete: RelationMutate::CASCADE(), // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index f0fd37d6..197179e8 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -26,4 +26,5 @@ $result = $tablesDB->updateRow( ], // optional permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index baf98ecf..5e9dd0aa 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -23,4 +23,5 @@ $result = $tablesDB->updateRows( ], // optional queries: [], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index ff01707d..b70a8c5c 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->updateStringColumn( default: '', size: 1, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 7ce092d1..1881d2e2 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -21,4 +21,5 @@ $result = $tablesDB->updateTable( rowSecurity: false, // optional enabled: false, // optional purge: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index 81fa0fec..1720878e 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateTextColumn( required: false, default: '', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index 512760bf..ee2c7fab 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -15,4 +15,5 @@ $result = $tablesDB->updateTransaction( transactionId: '', commit: false, // optional rollback: false // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 6c055168..a8f0964a 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -18,4 +18,5 @@ $result = $tablesDB->updateUrlColumn( required: false, default: 'https://example.com', newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index ca4ba824..db7b428a 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -19,4 +19,5 @@ $result = $tablesDB->updateVarcharColumn( default: '', size: 1, // optional newKey: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index c5bafb8d..24d46560 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -18,4 +18,5 @@ $result = $tablesDB->update( specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 5c4645ba..37786239 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -26,4 +26,5 @@ $result = $tablesDB->upsertRow( ], // optional permissions: [Permission::read(Role::any())], // optional transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index 6d9d6154..56aa2657 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -16,4 +16,5 @@ $result = $tablesDB->upsertRows( tableId: '', rows: [], transactionId: '' // optional -);``` +); +``` diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md index e462cf6b..b61627f9 100644 --- a/docs/examples/teams/create-installation.md +++ b/docs/examples/teams/create-installation.md @@ -15,4 +15,5 @@ $result = $teams->createInstallation( teamId: '', appId: '', authorizationDetails: '' // optional -);``` +); +``` diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index ddbddc38..4c09dc7e 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -19,4 +19,5 @@ $result = $teams->createMembership( phone: '+12065550100', // optional url: 'https://example.com', // optional name: '' // optional -);``` +); +``` diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index e0eef909..c4112e99 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -15,4 +15,5 @@ $result = $teams->create( teamId: '', name: '', roles: [] // optional -);``` +); +``` diff --git a/docs/examples/teams/delete-installation.md b/docs/examples/teams/delete-installation.md index 091ae091..ead89460 100644 --- a/docs/examples/teams/delete-installation.md +++ b/docs/examples/teams/delete-installation.md @@ -14,4 +14,5 @@ $teams = new Teams($client); $result = $teams->deleteInstallation( teamId: '', installationId: '' -);``` +); +``` diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 096d69eb..fd686ec2 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -14,4 +14,5 @@ $teams = new Teams($client); $result = $teams->deleteMembership( teamId: '', membershipId: '' -);``` +); +``` diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index e982d579..af3754d9 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -13,4 +13,5 @@ $teams = new Teams($client); $result = $teams->delete( teamId: '' -);``` +); +``` diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md index 440afa82..8d9a8bbd 100644 --- a/docs/examples/teams/get-installation.md +++ b/docs/examples/teams/get-installation.md @@ -14,4 +14,5 @@ $teams = new Teams($client); $result = $teams->getInstallation( teamId: '', installationId: '' -);``` +); +``` diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index c696fd0d..54189773 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -14,4 +14,5 @@ $teams = new Teams($client); $result = $teams->getMembership( teamId: '', membershipId: '' -);``` +); +``` diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index ea621f3a..eb7022b3 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -13,4 +13,5 @@ $teams = new Teams($client); $result = $teams->getPrefs( teamId: '' -);``` +); +``` diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index b0a71242..4c4ed589 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -13,4 +13,5 @@ $teams = new Teams($client); $result = $teams->get( teamId: '' -);``` +); +``` diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md index 678ab4bc..b772c3b1 100644 --- a/docs/examples/teams/list-installations.md +++ b/docs/examples/teams/list-installations.md @@ -15,4 +15,5 @@ $result = $teams->listInstallations( teamId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 0b4fd915..91991193 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -16,4 +16,5 @@ $result = $teams->listMemberships( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 04fdc4fc..118339e2 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -15,4 +15,5 @@ $result = $teams->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md index 36cdd030..17751638 100644 --- a/docs/examples/teams/update-installation.md +++ b/docs/examples/teams/update-installation.md @@ -15,4 +15,5 @@ $result = $teams->updateInstallation( teamId: '', installationId: '', authorizationDetails: '' // optional -);``` +); +``` diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 33f891c1..b83abc88 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -16,4 +16,5 @@ $result = $teams->updateMembershipStatus( membershipId: '', userId: '', secret: '' -);``` +); +``` diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 0a251890..87741774 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -15,4 +15,5 @@ $result = $teams->updateMembership( teamId: '', membershipId: '', roles: [] -);``` +); +``` diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index eae3a3bf..21260a37 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -14,4 +14,5 @@ $teams = new Teams($client); $result = $teams->updateName( teamId: '', name: '' -);``` +); +``` diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 785f7ba9..c6a98331 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -14,4 +14,5 @@ $teams = new Teams($client); $result = $teams->updatePrefs( teamId: '', prefs: [] -);``` +); +``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index af8391f1..c700c568 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -15,4 +15,5 @@ $result = $tokens->createFileToken( bucketId: '', fileId: '', expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); +``` diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index d298ed3a..2c4aea6f 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -13,4 +13,5 @@ $tokens = new Tokens($client); $result = $tokens->delete( tokenId: '' -);``` +); +``` diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index db117e6a..37911e25 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -13,4 +13,5 @@ $tokens = new Tokens($client); $result = $tokens->get( tokenId: '' -);``` +); +``` diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 35512617..724d44ed 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -16,4 +16,5 @@ $result = $tokens->list( fileId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 870b3fa3..9944a9ce 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -14,4 +14,5 @@ $tokens = new Tokens($client); $result = $tokens->update( tokenId: '', expire: '2020-10-15T06:38:00.000+00:00' // optional -);``` +); +``` diff --git a/docs/examples/users/create-argon-2-user.md b/docs/examples/users/create-argon-2-user.md index 4813cd8b..34018bc6 100644 --- a/docs/examples/users/create-argon-2-user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -16,4 +16,5 @@ $result = $users->createArgon2User( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 17a3c7ec..c8badcaf 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -16,4 +16,5 @@ $result = $users->createBcryptUser( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index 9a22a606..2bb9fed1 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -13,6 +13,7 @@ $users = new Users($client); $result = $users->createJWT( userId: '', - sessionId: '', // optional + sessionId: '', // optional duration: 0 // optional -);``` +); +``` diff --git a/docs/examples/users/create-md-5-user.md b/docs/examples/users/create-md-5-user.md index 85e97f75..30478335 100644 --- a/docs/examples/users/create-md-5-user.md +++ b/docs/examples/users/create-md-5-user.md @@ -16,4 +16,5 @@ $result = $users->createMD5User( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 23295475..d58681a4 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->createMFARecoveryCodes( userId: '' -);``` +); +``` diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md index 0e9a62ff..c9426373 100644 --- a/docs/examples/users/create-ph-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -16,4 +16,5 @@ $result = $users->createPHPassUser( email: 'email@example.com', password: 'password', name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 22c18b1e..bd3077e7 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -19,4 +19,5 @@ $result = $users->createScryptModifiedUser( passwordSaltSeparator: '', passwordSignerKey: '', name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 8ebc44dd..d9565163 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -21,4 +21,5 @@ $result = $users->createScryptUser( passwordParallel: null, passwordLength: null, name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 0279835a..625cd849 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->createSession( userId: '' -);``` +); +``` diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index 924224bc..94a674cb 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -18,4 +18,5 @@ $result = $users->createSHAUser( password: 'password', passwordVersion: PasswordHash::SHA1(), // optional name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 1000574f..e9d83ebb 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -19,4 +19,5 @@ $result = $users->createTarget( identifier: '', providerId: '', // optional name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 4519995f..b346dd53 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -15,4 +15,5 @@ $result = $users->createToken( userId: '', length: 4, // optional expire: 60 // optional -);``` +); +``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index a2feb7c3..0409e50f 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -17,4 +17,5 @@ $result = $users->create( phone: '+12065550100', // optional password: 'password', // optional name: '' // optional -);``` +); +``` diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index b364358d..9a812db6 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->deleteIdentity( identityId: '' -);``` +); +``` diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 15ca8e29..8fa62661 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -15,4 +15,5 @@ $users = new Users($client); $result = $users->deleteMFAAuthenticator( userId: '', type: AuthenticatorType::TOTP() -);``` +); +``` diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 9786bde4..3279befe 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->deleteSession( userId: '', sessionId: '' -);``` +); +``` diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 236aeffe..df58398a 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->deleteSessions( userId: '' -);``` +); +``` diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 6d915dbe..ed23c177 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->deleteTarget( userId: '', targetId: '' -);``` +); +``` diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index faea96cf..dd79743b 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->delete( userId: '' -);``` +); +``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md index 8ef5c4aa..4f6202df 100644 --- a/docs/examples/users/get-mfa-challenge.md +++ b/docs/examples/users/get-mfa-challenge.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->getMFAChallenge( userId: '', challengeId: '' -);``` +); +``` diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 90aa08dd..3978e1a8 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->getMFARecoveryCodes( userId: '' -);``` +); +``` diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 931c5be8..72ebd61a 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->getPrefs( userId: '' -);``` +); +``` diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 1f3c0028..8f86c11c 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->getTarget( userId: '', targetId: '' -);``` +); +``` diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index a777b73b..f974d7c0 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->get( userId: '' -);``` +); +``` diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 37074100..38b1be77 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -15,4 +15,5 @@ $result = $users->listIdentities( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 0d0464e2..b050bab0 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -15,4 +15,5 @@ $result = $users->listLogs( userId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index c9b3fb54..b198103b 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -16,4 +16,5 @@ $result = $users->listMemberships( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index c3cd0453..ace853e6 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->listMFAFactors( userId: '' -);``` +); +``` diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index e4baa40c..12c5cbe0 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->listSessions( userId: '', total: false // optional -);``` +); +``` diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 3e33f9f4..468ac2e2 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -15,4 +15,5 @@ $result = $users->listTargets( userId: '', queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 39d3189c..87b03f3c 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -15,4 +15,5 @@ $result = $users->list( queries: [], // optional search: '', // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index b7a3a912..b188568a 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updateEmailVerification( userId: '', emailVerification: false -);``` +); +``` diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 2710f496..d30f7d11 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updateEmail( userId: '', email: 'email@example.com' -);``` +); +``` diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md index 202f0ed2..b1e9e99f 100644 --- a/docs/examples/users/update-impersonator.md +++ b/docs/examples/users/update-impersonator.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updateImpersonator( userId: '', impersonator: false -);``` +); +``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 56be4fbc..7ac457f5 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updateLabels( userId: '', labels: [] -);``` +); +``` diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index bee4d183..adee4c7c 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -13,4 +13,5 @@ $users = new Users($client); $result = $users->updateMFARecoveryCodes( userId: '' -);``` +); +``` diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 9cac2ff9..6ff44fef 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updateMFA( userId: '', mfa: false -);``` +); +``` diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index bce3d8c7..fd274018 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updateName( userId: '', name: '' -);``` +); +``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index d8f2ed1c..512c67b6 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updatePassword( userId: '', password: 'password' -);``` +); +``` diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index f94b1f84..0cfb243d 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updatePhoneVerification( userId: '', phoneVerification: false -);``` +); +``` diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index c975eaf1..b07c4bd8 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updatePhone( userId: '', number: '+12065550100' -);``` +); +``` diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index b276922c..450f7a4b 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updatePrefs( userId: '', prefs: [] -);``` +); +``` diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 1a8346c0..b9e003d9 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -14,4 +14,5 @@ $users = new Users($client); $result = $users->updateStatus( userId: '', status: false -);``` +); +``` diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 89635691..c4efc592 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -17,4 +17,5 @@ $result = $users->updateTarget( identifier: '', // optional providerId: '', // optional name: '' // optional -);``` +); +``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index dd8eb1cd..2f99091d 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -21,4 +21,5 @@ $result = $webhooks->create( authUsername: '', // optional authPassword: 'password', // optional secret: '' // optional -);``` +); +``` diff --git a/docs/examples/webhooks/delete.md b/docs/examples/webhooks/delete.md index cab10635..c96a1d5f 100644 --- a/docs/examples/webhooks/delete.md +++ b/docs/examples/webhooks/delete.md @@ -13,4 +13,5 @@ $webhooks = new Webhooks($client); $result = $webhooks->delete( webhookId: '' -);``` +); +``` diff --git a/docs/examples/webhooks/get.md b/docs/examples/webhooks/get.md index c8acae75..85e95776 100644 --- a/docs/examples/webhooks/get.md +++ b/docs/examples/webhooks/get.md @@ -13,4 +13,5 @@ $webhooks = new Webhooks($client); $result = $webhooks->get( webhookId: '' -);``` +); +``` diff --git a/docs/examples/webhooks/list.md b/docs/examples/webhooks/list.md index 7727c468..e0652d51 100644 --- a/docs/examples/webhooks/list.md +++ b/docs/examples/webhooks/list.md @@ -14,4 +14,5 @@ $webhooks = new Webhooks($client); $result = $webhooks->list( queries: [], // optional total: false // optional -);``` +); +``` diff --git a/docs/examples/webhooks/update-secret.md b/docs/examples/webhooks/update-secret.md index 73c3f955..6a8168d5 100644 --- a/docs/examples/webhooks/update-secret.md +++ b/docs/examples/webhooks/update-secret.md @@ -14,4 +14,5 @@ $webhooks = new Webhooks($client); $result = $webhooks->updateSecret( webhookId: '', secret: '' // optional -);``` +); +``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index c6bf00b2..eeecf88a 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -20,4 +20,5 @@ $result = $webhooks->update( tls: false, // optional authUsername: '', // optional authPassword: 'password' // optional -);``` +); +``` diff --git a/docs/functions.md b/docs/functions.md index bc4a62ed..00ae7360 100644 --- a/docs/functions.md +++ b/docs/functions.md @@ -5,7 +5,7 @@ GET https://cloud.appwrite.io/v1/functions ``` -** Get a list of all the project's functions. You can use the query params to filter your results. ** +** Get a list of all the project's functions. You can use the query params to filter your results. ** ### Parameters @@ -148,7 +148,7 @@ PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployment GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments ``` -** Get a list of all the function's code deployments. You can use the query params to filter your results. ** +** Get a list of all the function's code deployments. You can use the query params to filter your results. ** ### Parameters @@ -164,11 +164,11 @@ GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments ``` -** Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. +** Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions). -Use the "command" param to set the entrypoint used to execute your code. ** +Use the "command" param to set the entrypoint used to execute your code. ** ### Parameters @@ -185,7 +185,7 @@ Use the "command" param to set the entrypoint used to execute your cod POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments/duplicate ``` -** Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** +** Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** ### Parameters @@ -267,7 +267,7 @@ DELETE https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deployme GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId}/download ``` -** Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** +** Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** ### Parameters @@ -283,7 +283,7 @@ GET https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentI PATCH https://cloud.appwrite.io/v1/functions/{functionId}/deployments/{deploymentId}/status ``` -** Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** +** Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** ### Parameters @@ -382,7 +382,7 @@ POST https://cloud.appwrite.io/v1/functions/{functionId}/variables | --- | --- | --- | --- | | functionId | string | **Required** Function unique ID. | | | variableId | string | Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only functions can read them during build and runtime. | 1 | @@ -413,7 +413,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId}/variables/{variableId} | --- | --- | --- | --- | | functionId | string | **Required** Function unique ID. | | | variableId | string | **Required** Variable unique ID. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only functions can read them during build and runtime. | | diff --git a/docs/oauth2.md b/docs/oauth2.md index c5e315e6..37e2083b 100644 --- a/docs/oauth2.md +++ b/docs/oauth2.md @@ -121,7 +121,7 @@ GET https://cloud.appwrite.io/v1/oauth2/{project_id}/grants/{grant_id} GET https://cloud.appwrite.io/v1/oauth2/{project_id}/organizations ``` -** List the organizations the OAuth2 access token can access. Resolves the token's `organization` authorization details, expanding the `*` wildcard into the concrete set of organizations the user can see. ** +** List the organizations the OAuth2 access token can access. Resolves the token's `organization` authorization details, expanding the `*` wildcard into the concrete set of organizations the user can see. ** ### Parameters @@ -163,7 +163,7 @@ POST https://cloud.appwrite.io/v1/oauth2/{project_id}/par GET https://cloud.appwrite.io/v1/oauth2/{project_id}/projects ``` -** List the projects the OAuth2 access token can access. Resolves the token's `project` authorization details, expanding the `*` wildcard into the concrete set of projects the user can see. ** +** List the projects the OAuth2 access token can access. Resolves the token's `project` authorization details, expanding the `*` wildcard into the concrete set of projects the user can see. ** ### Parameters diff --git a/docs/organization.md b/docs/organization.md index 1508fbc8..6e0e7705 100644 --- a/docs/organization.md +++ b/docs/organization.md @@ -12,7 +12,7 @@ GET https://cloud.appwrite.io/v1/organization PUT https://cloud.appwrite.io/v1/organization ``` -** Update the current organization's name. ** +** Update the current organization's name. ** ### Parameters @@ -73,7 +73,7 @@ GET https://cloud.appwrite.io/v1/organization/installations/{installationId} PUT https://cloud.appwrite.io/v1/organization/installations/{installationId} ``` -** Update an app installation on the organization. Only organization members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. ** +** Update an app installation on the organization. Only organization members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. ** ### Parameters @@ -187,7 +187,7 @@ GET https://cloud.appwrite.io/v1/organization/memberships POST https://cloud.appwrite.io/v1/organization/memberships ``` -** Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. ** +** Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. ** ### Parameters @@ -268,7 +268,7 @@ POST https://cloud.appwrite.io/v1/organization/projects | --- | --- | --- | --- | | projectId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. | | | name | string | Project name. Max length: 128 chars. | | -| region | string | Project Region. | | +| region | string | Project Region. | default | ```http request diff --git a/docs/project.md b/docs/project.md index 39a21349..dc09a767 100644 --- a/docs/project.md +++ b/docs/project.md @@ -47,7 +47,7 @@ GET https://cloud.appwrite.io/v1/project/keys POST https://cloud.appwrite.io/v1/project/keys/ephemeral ``` -** Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. +** Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. You can also create a standard API key if you need a longer-lived key instead. ** @@ -146,7 +146,7 @@ POST https://cloud.appwrite.io/v1/project/mock-phones GET https://cloud.appwrite.io/v1/project/mock-phones/{number} ``` -** Get a mock phone by its unique number. This endpoint returns the mock phone's OTP. ** +** Get a mock phone by its unique number. This endpoint returns the mock phone's OTP. ** ### Parameters @@ -159,7 +159,7 @@ GET https://cloud.appwrite.io/v1/project/mock-phones/{number} PUT https://cloud.appwrite.io/v1/project/mock-phones/{number} ``` -** Update a mock phone by its unique number. Use this endpoint to update the mock phone's OTP. ** +** Update a mock phone by its unique number. Use this endpoint to update the mock phone's OTP. ** ### Parameters @@ -186,7 +186,7 @@ DELETE https://cloud.appwrite.io/v1/project/mock-phones/{number} GET https://cloud.appwrite.io/v1/project/oauth2 ``` -** Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty. ** +** Get a list of all OAuth2 providers supported by the server, along with the project's configuration for each. Credential fields are write-only and always returned empty. ** ### Parameters @@ -531,6 +531,21 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/google | enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | +```http request +PATCH https://cloud.appwrite.io/v1/project/oauth2/huggingface +``` + +** Update the project OAuth2 Hugging Face configuration. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| clientId | string | 'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24 | | +| clientSecret | string | 'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt | | +| enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | + + ```http request PATCH https://cloud.appwrite.io/v1/project/oauth2/keycloak ``` @@ -933,7 +948,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/android PUT https://cloud.appwrite.io/v1/project/platforms/android/{platformId} ``` -** Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. ** +** Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. ** ### Parameters @@ -963,7 +978,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/apple PUT https://cloud.appwrite.io/v1/project/platforms/apple/{platformId} ``` -** Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. ** +** Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. ** ### Parameters @@ -993,7 +1008,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/linux PUT https://cloud.appwrite.io/v1/project/platforms/linux/{platformId} ``` -** Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. ** +** Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. ** ### Parameters @@ -1023,7 +1038,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/web PUT https://cloud.appwrite.io/v1/project/platforms/web/{platformId} ``` -** Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. ** +** Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. ** ### Parameters @@ -1053,7 +1068,7 @@ POST https://cloud.appwrite.io/v1/project/platforms/windows PUT https://cloud.appwrite.io/v1/project/platforms/windows/{platformId} ``` -** Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. ** +** Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. ** ### Parameters @@ -1068,7 +1083,7 @@ PUT https://cloud.appwrite.io/v1/project/platforms/windows/{platformId} GET https://cloud.appwrite.io/v1/project/platforms/{platformId} ``` -** Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ** +** Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ** ### Parameters @@ -1358,7 +1373,7 @@ PATCH https://cloud.appwrite.io/v1/project/services/{serviceId} PATCH https://cloud.appwrite.io/v1/project/smtp ``` -** Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ** +** Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ** ### Parameters @@ -1462,7 +1477,7 @@ POST https://cloud.appwrite.io/v1/project/variables | Field Name | Type | Description | Default | | --- | --- | --- | --- | | variableId | string | Variable unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only projects can read them during build and runtime. | 1 | @@ -1491,7 +1506,7 @@ PUT https://cloud.appwrite.io/v1/project/variables/{variableId} | Field Name | Type | Description | Default | | --- | --- | --- | --- | | variableId | string | **Required** Variable unique ID. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only projects can read them during build and runtime. | | diff --git a/docs/proxy.md b/docs/proxy.md index b429411d..baf24feb 100644 --- a/docs/proxy.md +++ b/docs/proxy.md @@ -36,7 +36,7 @@ GET https://cloud.appwrite.io/v1/proxy/rules POST https://cloud.appwrite.io/v1/proxy/rules/api ``` -** Create a new proxy rule for serving Appwrite's API on custom domain. +** Create a new proxy rule for serving Appwrite's API on custom domain. Rule ID is automatically generated as MD5 hash of a rule domain for performance purposes. ** diff --git a/docs/sites.md b/docs/sites.md index dac7de92..6fdd49d0 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -5,7 +5,7 @@ GET https://cloud.appwrite.io/v1/sites ``` -** Get a list of all the project's sites. You can use the query params to filter your results. ** +** Get a list of all the project's sites. You can use the query params to filter your results. ** ### Parameters @@ -49,6 +49,7 @@ POST https://cloud.appwrite.io/v1/sites | buildSpecification | string | Build specification for the site deployments. | [] | | runtimeSpecification | string | Runtime specification for the SSR executions. | [] | | deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 | +| scopes | array | List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. | [] | ```http request @@ -117,6 +118,7 @@ PUT https://cloud.appwrite.io/v1/sites/{siteId} | buildSpecification | string | Build specification for the site deployments. | | | runtimeSpecification | string | Runtime specification for the SSR executions. | [] | | deploymentRetention | integer | Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. | 0 | +| scopes | array | List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. | | ```http request @@ -150,7 +152,7 @@ PATCH https://cloud.appwrite.io/v1/sites/{siteId}/deployment GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments ``` -** Get a list of all the site's code deployments. You can use the query params to filter your results. ** +** Get a list of all the site's code deployments. You can use the query params to filter your results. ** ### Parameters @@ -166,7 +168,7 @@ GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments ``` -** Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID. ** +** Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID. ** ### Parameters @@ -184,7 +186,7 @@ POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments/duplicate ``` -** Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** +** Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. ** ### Parameters @@ -265,7 +267,7 @@ DELETE https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId} GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/download ``` -** Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** +** Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** ### Parameters @@ -281,7 +283,7 @@ GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/downl PATCH https://cloud.appwrite.io/v1/sites/{siteId}/deployments/{deploymentId}/status ``` -** Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** +** Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. ** ### Parameters @@ -361,7 +363,7 @@ POST https://cloud.appwrite.io/v1/sites/{siteId}/variables | --- | --- | --- | --- | | siteId | string | **Required** Site unique ID. | | | variableId | string | Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only sites can read them during build and runtime. | 1 | @@ -392,7 +394,7 @@ PUT https://cloud.appwrite.io/v1/sites/{siteId}/variables/{variableId} | --- | --- | --- | --- | | siteId | string | **Required** Site unique ID. | | | variableId | string | **Required** Variable unique ID. | | -| key | string | Variable key. Max length: 255 chars. | | +| key | string | Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. | | | value | string | Variable value. Max length: 8192 chars. | | | secret | boolean | Secret variables can be updated or deleted, but only sites can read them during build and runtime. | | diff --git a/docs/storage.md b/docs/storage.md index 86acceb0..cecf8af3 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -112,9 +112,9 @@ POST https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes. -When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. +When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. -If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. +If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. ** ### Parameters @@ -176,7 +176,7 @@ DELETE https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId} GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/download ``` -** Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** +** Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** ### Parameters @@ -217,7 +217,7 @@ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/previ GET https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}/view ``` -** Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. ** +** Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. ** ### Parameters diff --git a/docs/tablesdb.md b/docs/tablesdb.md index 49f78e2f..bdd7882d 100644 --- a/docs/tablesdb.md +++ b/docs/tablesdb.md @@ -171,7 +171,7 @@ DELETE https://cloud.appwrite.io/v1/tablesdb/{databaseId} POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/failovers ``` -** Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote. ** +** Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. ** ### Parameters @@ -1187,7 +1187,7 @@ DELETE https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/index GET https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/rows ``` -** Get a list of all the user's rows in a given table. You can use the query params to filter your results. ** +** Get a list of all the user's rows in a given table. You can use the query params to filter your results. ** ### Parameters diff --git a/docs/teams.md b/docs/teams.md index 60315577..6f465c7a 100644 --- a/docs/teams.md +++ b/docs/teams.md @@ -48,7 +48,7 @@ GET https://cloud.appwrite.io/v1/teams/{teamId} PUT https://cloud.appwrite.io/v1/teams/{teamId} ``` -** Update the team's name by its unique ID. ** +** Update the team's name by its unique ID. ** ### Parameters @@ -119,7 +119,7 @@ GET https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId} PUT https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId} ``` -** Update an app installation on a team. Only team members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. ** +** Update an app installation on a team. Only team members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. ** ### Parameters @@ -148,7 +148,7 @@ DELETE https://cloud.appwrite.io/v1/teams/{teamId}/installations/{installationId GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships ``` -** Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. ** +** Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. ** ### Parameters @@ -164,9 +164,9 @@ GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships POST https://cloud.appwrite.io/v1/teams/{teamId}/memberships ``` -** Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. +** Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. -You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. +You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. @@ -253,7 +253,7 @@ If the request is successful, a session for the user is automatically created. GET https://cloud.appwrite.io/v1/teams/{teamId}/prefs ``` -** Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). ** +** Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). ** ### Parameters @@ -266,7 +266,7 @@ GET https://cloud.appwrite.io/v1/teams/{teamId}/prefs PUT https://cloud.appwrite.io/v1/teams/{teamId}/prefs ``` -** Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. ** +** Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. ** ### Parameters diff --git a/docs/tokens.md b/docs/tokens.md index f474d1c4..bc3b9746 100644 --- a/docs/tokens.md +++ b/docs/tokens.md @@ -49,7 +49,7 @@ GET https://cloud.appwrite.io/v1/tokens/{tokenId} PATCH https://cloud.appwrite.io/v1/tokens/{tokenId} ``` -** Update a token by its unique ID. Use this endpoint to update a token's expiry date. ** +** Update a token by its unique ID. Use this endpoint to update a token's expiry date. ** ### Parameters diff --git a/docs/users.md b/docs/users.md index 7ded8472..11a02a9a 100644 --- a/docs/users.md +++ b/docs/users.md @@ -5,7 +5,7 @@ GET https://cloud.appwrite.io/v1/users ``` -** Get a list of all the project's users. You can use the query params to filter your results. ** +** Get a list of all the project's users. You can use the query params to filter your results. ** ### Parameters @@ -199,7 +199,7 @@ GET https://cloud.appwrite.io/v1/users/{userId} DELETE https://cloud.appwrite.io/v1/users/{userId} ``` -** Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. ** +** Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. ** ### Parameters @@ -248,7 +248,7 @@ POST https://cloud.appwrite.io/v1/users/{userId}/jwts | Field Name | Type | Description | Default | | --- | --- | --- | --- | | userId | string | **Required** User ID. | | -| sessionId | string | Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. | recent | +| sessionId | string | Session ID. Use the string 'recent()' to use the most recent session, which is also the default. | recent() | | duration | integer | Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. | 900 | @@ -258,7 +258,7 @@ PUT https://cloud.appwrite.io/v1/users/{userId}/labels ** Update the user labels by its unique ID. -Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. ** +Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. ** ### Parameters @@ -575,7 +575,7 @@ If you want to generate a token for a custom authentication flow, use the [POST DELETE https://cloud.appwrite.io/v1/users/{userId}/sessions ``` -** Delete all user's sessions by using the user's unique ID. ** +** Delete all user's sessions by using the user's unique ID. ** ### Parameters @@ -602,7 +602,7 @@ DELETE https://cloud.appwrite.io/v1/users/{userId}/sessions/{sessionId} PATCH https://cloud.appwrite.io/v1/users/{userId}/status ``` -** Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. ** +** Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. ** ### Parameters @@ -649,7 +649,7 @@ POST https://cloud.appwrite.io/v1/users/{userId}/targets GET https://cloud.appwrite.io/v1/users/{userId}/targets/{targetId} ``` -** Get a user's push notification target by ID. ** +** Get a user's push notification target by ID. ** ### Parameters diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..0945edb2 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,8 @@ +includes: + - vendor/phpstan/phpstan-mockery/extension.neon + +parameters: + level: 5 + paths: + - src + - tests diff --git a/pint.json b/pint.json new file mode 100644 index 00000000..ea5e72cf --- /dev/null +++ b/pint.json @@ -0,0 +1,3 @@ +{ + "preset": "psr12" +} diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..1f640cfc --- /dev/null +++ b/rector.php @@ -0,0 +1,19 @@ +withPaths([ + getcwd() . '/src', + getcwd() . '/tests', + ]) + ->withPhpSets() + ->withPreparedSets( + deadCode: true, + codeQuality: true, + typeDeclarations: true, + earlyReturn: true, + phpunitCodeQuality: true, + ); diff --git a/src/Appwrite/AppwriteException.php b/src/Appwrite/AppwriteException.php index 31d7927f..463eb3f9 100644 --- a/src/Appwrite/AppwriteException.php +++ b/src/Appwrite/AppwriteException.php @@ -1,51 +1,29 @@ response = $response; - $this->type = $type; - } + public function getType(): string + { + return $this->type; + } - /** - * @return string - */ - public function getType(): string - { - return $this->type; - } - - /** - * @return ?string - */ - final public function getResponse(): ?string - { - return $this->response; - } -} \ No newline at end of file + final public function getResponse(): ?string + { + return $this->response; + } +} diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index e56b2adc..75d272af 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -1,101 +1,116 @@ '', - 'user-agent' => 'AppwritePHPSDK/28.0.0 ()', - 'x-sdk-name'=> 'PHP', - 'x-sdk-platform'=> 'server', - 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '28.0.0', + 'user-agent' => 'AppwritePHPSDK/29.0.0 ()', + 'x-sdk-name' => 'PHP', + 'x-sdk-platform' => 'server', + 'x-sdk-language' => 'php', + 'x-sdk-version' => '29.0.0', ]; /** * Auth/config values used by generated service methods. * - * @var array */ protected array $config = []; /** * API key for JWT generation * - * @var string|null */ protected ?string $key = null; /** * Cached authorization header value * - * @var string|null */ protected ?string $authorization = null; /** * Authorization header expiry time * - * @var \DateTime|null */ protected ?\DateTime $authorizationExpiresAt = null; /** * Timeout in seconds * - * @var int|null */ protected ?int $timeout = null; /** * Connect timeout in seconds * - * @var int|null */ protected ?int $connectTimeout = null; + /** + * Reused Utopia HTTP client (follows redirects). + * + */ + protected ?HttpClient $httpClient = null; + + /** + * Reused Utopia HTTP client that does not follow redirects. + * + */ + protected ?HttpClient $httpClientNoRedirect = null; + + /** + * PSR-7 request factory. + * + */ + protected RequestFactory $requestFactory; + /** * Client constructor. */ public function __construct() { + $this->requestFactory = new RequestFactory(); $this->headers['X-Appwrite-Response-Format'] = '1.9.6'; - } /** @@ -103,9 +118,7 @@ public function __construct() * * Your project ID * - * @param string $value * - * @return Client */ public function setProject(string $value): Client { @@ -119,9 +132,7 @@ public function setProject(string $value): Client * * Your secret API key * - * @param string $value * - * @return Client */ public function setKey(string $value): Client { @@ -136,9 +147,7 @@ public function setKey(string $value): Client * * Your organization ID * - * @param string $value * - * @return Client */ public function setOrganization(string $value): Client { @@ -153,9 +162,7 @@ public function setOrganization(string $value): Client * * Your secret JSON Web Token * - * @param string $value * - * @return Client */ public function setJWT(string $value): Client { @@ -170,9 +177,7 @@ public function setJWT(string $value): Client * * The OAuth access token to authenticate with * - * @param string $value * - * @return Client */ public function setBearer(string $value): Client { @@ -188,9 +193,7 @@ public function setBearer(string $value): Client /** * Set Locale * - * @param string $value * - * @return Client */ public function setLocale(string $value): Client { @@ -205,9 +208,7 @@ public function setLocale(string $value): Client * * The user session to authenticate with * - * @param string $value * - * @return Client */ public function setSession(string $value): Client { @@ -222,9 +223,7 @@ public function setSession(string $value): Client * * The user agent string of the client that made the request * - * @param string $value * - * @return Client */ public function setForwardedUserAgent(string $value): Client { @@ -239,9 +238,7 @@ public function setForwardedUserAgent(string $value): Client * * Your secret dev API key * - * @param string $value * - * @return Client */ public function setDevKey(string $value): Client { @@ -256,9 +253,7 @@ public function setDevKey(string $value): Client * * The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes. * - * @param string $value * - * @return Client */ public function setCookie(string $value): Client { @@ -273,9 +268,7 @@ public function setCookie(string $value): Client * * Impersonate a user by ID * - * @param string $value * - * @return Client */ public function setImpersonateUserId(string $value): Client { @@ -290,9 +283,7 @@ public function setImpersonateUserId(string $value): Client * * Impersonate a user by email * - * @param string $value * - * @return Client */ public function setImpersonateUserEmail(string $value): Client { @@ -307,9 +298,7 @@ public function setImpersonateUserEmail(string $value): Client * * Impersonate a user by phone * - * @param string $value * - * @return Client */ public function setImpersonateUserPhone(string $value): Client { @@ -324,9 +313,7 @@ public function setImpersonateUserPhone(string $value): Client * * Set a secret key used to self-sign short-lived JWTs for the Authorization header * - * @param string $key * - * @return Client */ public function setSigningKey(string $key): Client { @@ -345,19 +332,16 @@ public function getConfig(string $key): string } /*** - * @param bool $status - * @return $this */ public function setSelfSigned(bool $status = true): Client { $this->selfSigned = $status; + $this->resetHttpClient(); return $this; } /*** - * @param $endpoint - * @return $this */ public function setEndpoint(string $endpoint): Client { @@ -366,36 +350,36 @@ public function setEndpoint(string $endpoint): Client } $this->endpoint = $endpoint; + $this->resetHttpClient(); + return $this; } /** * Set Timeout * - * @param int $timeout Timeout in seconds - * @return Client */ public function setTimeout(int $timeout): Client { $this->timeout = $timeout; + $this->resetHttpClient(); + return $this; } /** * Set Connect Timeout * - * @param int $connectTimeout Connect timeout in seconds - * @return Client */ public function setConnectTimeout(int $connectTimeout): Client { $this->connectTimeout = $connectTimeout; + $this->resetHttpClient(); + return $this; } /** - * @param $key - * @param $value */ public function addHeader(string $key, string $value): Client { @@ -407,7 +391,6 @@ public function addHeader(string $key, string $value): Client /** * Get the request headers. * - * @return array */ public function getHeaders(): array { @@ -417,7 +400,6 @@ public function getHeaders(): array /** * Get authorization header, generating a new JWT if needed * - * @return string */ private function getAuthorization(): string { @@ -428,7 +410,7 @@ private function getAuthorization(): string $jwt = new JWT($this->key, maxAge: self::JWT_MAX_AGE_SECONDS); $this->authorization = "Bearer {$jwt->encode([])}"; - $this->authorizationExpiresAt = (new \DateTime())->modify('+' . (self::JWT_MAX_AGE_SECONDS - 5) . ' seconds'); + $this->authorizationExpiresAt = new \DateTime()->modify('+' . (self::JWT_MAX_AGE_SECONDS - 5) . ' seconds'); return $this->authorization; } @@ -438,11 +420,6 @@ private function getAuthorization(): string * * Make an API call * - * @param string $method - * @param string $path - * @param array $params - * @param array $headers - * @return array|string * @throws AppwriteException */ public function call( @@ -451,102 +428,74 @@ public function call( array $headers = [], array $params = [], ?string $responseType = null - ) - { + ) { if ($this->key !== null) { $this->headers['authorization'] = $this->getAuthorization(); } $headers = array_merge($this->headers, $headers); - $querySeparator = str_contains($path, '?') ? '&' : '?'; - $ch = curl_init($this->endpoint . $path . (($method == self::METHOD_GET && !empty($params)) ? $querySeparator . http_build_query($params) : '')); - $responseHeaders = []; - - switch ($headers['content-type']) { - case 'application/json': - $query = json_encode($this->prepareParams($params)); - break; - - case 'multipart/form-data': - $query = $this->flatten($params); - break; - - default: - $query = http_build_query($params); - break; - } - - foreach ($headers as $i => $header) { - $headers[] = $i . ':' . $header; - unset($headers[$i]); - } - - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $responseType !== 'location'); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $len = strlen($header); - $header = explode(':', strtolower($header), 2); - - if (count($header) < 2) { // ignore invalid headers - return $len; - } - - $responseHeaders[strtolower(trim($header[0]))] = trim($header[1]); - - return $len; - }); - - if($method != self::METHOD_GET) { - curl_setopt($ch, CURLOPT_POSTFIELDS, $query); - } - - // Allow self signed certificates - if($this->selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + $contentType = strtolower((string) ($headers['content-type'] ?? '')); + if ($contentType === '') { + unset($headers['content-type']); } - - // Set timeout if configured - if($this->timeout !== null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); - } - - // Set connect timeout if configured - if($this->connectTimeout !== null) { - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->connectTimeout); + $uri = $this->endpoint . $path; + + try { + $request = match (true) { + $method === self::METHOD_GET => $this->requestFactory->query( + $method, + $uri, + $params, + $headers + ), + $contentType === 'application/json' => $this->requestFactory->json( + $method, + $uri, + $this->prepareParams($params), + $headers + ), + $contentType === 'multipart/form-data' => $this->requestFactory->multipart( + $method, + $uri, + $this->toMultipartParts($params), + $headers + ), + default => $this->requestFactory->form( + $method, + $uri, + $params, + $headers + ), + }; + + $response = $this->getHttpClient($responseType !== 'location')->sendRequest($request); + } catch (ClientExceptionInterface|\JsonException $e) { + throw new AppwriteException($e->getMessage(), (int) $e->getCode()); } - $responseBody = curl_exec($ch); - $contentType = $responseHeaders['content-type'] ?? ''; - $responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $responseStatus = $response->getStatusCode(); + $responseContentType = $response->getHeaderLine('content-type'); + $responseBody = (string) $response->getBody(); - $warnings = $responseHeaders['x-appwrite-warning'] ?? ''; + $warnings = $response->getHeaderLine('x-appwrite-warning'); if ($warnings) { - foreach(explode(';', $warnings) as $warning) { + foreach (explode(';', $warnings) as $warning) { \trigger_error($warning, E_USER_WARNING); } } - - if (str_starts_with($contentType, 'application/json')) { - $responseBody = json_decode($responseBody, true); - } - if (curl_errno($ch)) { - throw new AppwriteException(curl_error($ch), $responseStatus, $responseBody['type'] ?? '', $responseBody); + if (str_starts_with($responseContentType, 'application/json')) { + $responseBody = json_decode($responseBody, true); } - if($responseStatus >= 400) { - if(is_array($responseBody)) { + if ($responseStatus >= 400) { + if (is_array($responseBody)) { throw new AppwriteException($responseBody['message'], $responseStatus, $responseBody['type'] ?? '', json_encode($responseBody)); - } else { - throw new AppwriteException($responseBody, $responseStatus, '', $responseBody); } + throw new AppwriteException($responseBody, $responseStatus, '', $responseBody); } if ($responseType === 'location') { - return $responseHeaders['location']; + return $response->getHeaderLine('location'); } return $responseBody; @@ -555,20 +504,17 @@ public function call( /** * Flatten params array to PHP multiple format * - * @param array $data - * @param string $prefix - * @return array */ - protected function flatten(array $data, string $prefix = ''): array { + protected function flatten(array $data, string $prefix = ''): array + { $output = []; - foreach($data as $key => $value) { + foreach ($data as $key => $value) { $finalKey = $prefix ? "{$prefix}[{$key}]" : $key; if (is_array($value)) { $output = array_merge($output, $this->flatten($value, $finalKey)); - } - else { + } else { $output[$finalKey] = $value; } } @@ -579,13 +525,11 @@ protected function flatten(array $data, string $prefix = ''): array { /** * Prepare params for JSON encoding by converting model objects to arrays * - * @param mixed $data - * @return mixed */ protected function prepareParams($data) { if (is_array($data)) { - return array_map([$this, 'prepareParams'], $data); + return array_map($this->prepareParams(...), $data); } if (is_object($data) && method_exists($data, 'toArray')) { @@ -594,4 +538,82 @@ protected function prepareParams($data) return $data; } + + /** + * Convert flattened params into Utopia multipart parts. + * + * @param array $data + * @return array + */ + protected function toMultipartParts(array $data): array + { + $parts = []; + + foreach ($this->flatten($data) as $name => $value) { + $name = (string) $name; + + if ($value instanceof Part) { + $parts[$name] = $value; + continue; + } + + if ($value instanceof \CURLFile) { + $path = $value->getFilename(); + $filename = $value->getPostFilename() !== '' ? $value->getPostFilename() : null; + $mimeType = $value->getMimeType() !== '' ? $value->getMimeType() : null; + + if (is_file($path)) { + $parts[$name] = Part::file($name, $path, $filename, $mimeType); + } else { + $contents = @file_get_contents($path); + $parts[$name] = Part::body($name, $contents === false ? '' : $contents, $filename, $mimeType); + } + + continue; + } + + $parts[$name] = $value; + } + + return $parts; + } + + protected function getHttpClient(bool $followRedirects): HttpClient + { + if ($followRedirects) { + return $this->httpClient ??= $this->createHttpClient(true); + } + + return $this->httpClientNoRedirect ??= $this->createHttpClient(false); + } + + protected function resetHttpClient(): void + { + $this->httpClient = null; + $this->httpClientNoRedirect = null; + } + + protected function createHttpClient(bool $followRedirects): HttpClient + { + $adapter = new CurlAdapter(options: [ + CURLOPT_TIMEOUT_MS => 0, + CURLOPT_USERAGENT => php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion(), + ])->withConnectionReuse(); + + $client = new HttpClient($adapter)->withFollowRedirects($followRedirects); + + if ($this->selfSigned) { + $client = $client->withSslVerification(false); + } + + if ($this->timeout !== null) { + $client = $client->withTimeout($this->timeout); + } + + if ($this->connectTimeout !== null) { + return $client->withConnectTimeout($this->connectTimeout); + } + + return $client; + } } diff --git a/src/Appwrite/Enums/Adapter.php b/src/Appwrite/Enums/Adapter.php index b9be67f0..3cfec56a 100644 --- a/src/Appwrite/Enums/Adapter.php +++ b/src/Appwrite/Enums/Adapter.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/AttributeStatus.php b/src/Appwrite/Enums/AttributeStatus.php index 9ddf0b5e..f5058135 100644 --- a/src/Appwrite/Enums/AttributeStatus.php +++ b/src/Appwrite/Enums/AttributeStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/AuthenticationFactor.php b/src/Appwrite/Enums/AuthenticationFactor.php index 046cf53f..601dbafd 100644 --- a/src/Appwrite/Enums/AuthenticationFactor.php +++ b/src/Appwrite/Enums/AuthenticationFactor.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/AuthenticatorType.php b/src/Appwrite/Enums/AuthenticatorType.php index 74fe1c51..8d8b73a6 100644 --- a/src/Appwrite/Enums/AuthenticatorType.php +++ b/src/Appwrite/Enums/AuthenticatorType.php @@ -1,18 +1,18 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BackupServices.php b/src/Appwrite/Enums/BackupServices.php index eea40a7f..841ead28 100644 --- a/src/Appwrite/Enums/BackupServices.php +++ b/src/Appwrite/Enums/BackupServices.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BillingPlanGroup.php b/src/Appwrite/Enums/BillingPlanGroup.php index a58d7e91..04bcb58c 100644 --- a/src/Appwrite/Enums/BillingPlanGroup.php +++ b/src/Appwrite/Enums/BillingPlanGroup.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Browser.php b/src/Appwrite/Enums/Browser.php index c53dc05b..e0d5419d 100644 --- a/src/Appwrite/Enums/Browser.php +++ b/src/Appwrite/Enums/Browser.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BrowserPermission.php b/src/Appwrite/Enums/BrowserPermission.php index 71fa9b1f..003bb409 100644 --- a/src/Appwrite/Enums/BrowserPermission.php +++ b/src/Appwrite/Enums/BrowserPermission.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BrowserTheme.php b/src/Appwrite/Enums/BrowserTheme.php index 838a5a23..b0c284d2 100644 --- a/src/Appwrite/Enums/BrowserTheme.php +++ b/src/Appwrite/Enums/BrowserTheme.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/BuildRuntime.php b/src/Appwrite/Enums/BuildRuntime.php index ec65bb79..218a8c8f 100644 --- a/src/Appwrite/Enums/BuildRuntime.php +++ b/src/Appwrite/Enums/BuildRuntime.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string @@ -662,6 +663,13 @@ public static function BUN13(): BuildRuntime } return self::$BUN13; } + public static function BUN14(): BuildRuntime + { + if (!isset(self::$BUN14)) { + self::$BUN14 = new BuildRuntime('bun-1.4'); + } + return self::$BUN14; + } public static function GO123(): BuildRuntime { if (!isset(self::$GO123)) { @@ -842,6 +850,7 @@ public static function from(string $value): self 'bun-1.1' => self::BUN11(), 'bun-1.2' => self::BUN12(), 'bun-1.3' => self::BUN13(), + 'bun-1.4' => self::BUN14(), 'go-1.23' => self::GO123(), 'go-1.24' => self::GO124(), 'go-1.25' => self::GO125(), diff --git a/src/Appwrite/Enums/ColumnStatus.php b/src/Appwrite/Enums/ColumnStatus.php index 8ed9c71a..a601711b 100644 --- a/src/Appwrite/Enums/ColumnStatus.php +++ b/src/Appwrite/Enums/ColumnStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Compression.php b/src/Appwrite/Enums/Compression.php index ecfab333..fad5e5f2 100644 --- a/src/Appwrite/Enums/Compression.php +++ b/src/Appwrite/Enums/Compression.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/CreditCard.php b/src/Appwrite/Enums/CreditCard.php index c291380f..a99bca63 100644 --- a/src/Appwrite/Enums/CreditCard.php +++ b/src/Appwrite/Enums/CreditCard.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DatabaseStatus.php b/src/Appwrite/Enums/DatabaseStatus.php index 870c3932..d6e2edcf 100644 --- a/src/Appwrite/Enums/DatabaseStatus.php +++ b/src/Appwrite/Enums/DatabaseStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DatabaseType.php b/src/Appwrite/Enums/DatabaseType.php index 56d1cff0..9a336563 100644 --- a/src/Appwrite/Enums/DatabaseType.php +++ b/src/Appwrite/Enums/DatabaseType.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DatabasesIndexType.php b/src/Appwrite/Enums/DatabasesIndexType.php index 52443f4e..d4e6edac 100644 --- a/src/Appwrite/Enums/DatabasesIndexType.php +++ b/src/Appwrite/Enums/DatabasesIndexType.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DeploymentDownloadType.php b/src/Appwrite/Enums/DeploymentDownloadType.php index 59d278b2..4e848003 100644 --- a/src/Appwrite/Enums/DeploymentDownloadType.php +++ b/src/Appwrite/Enums/DeploymentDownloadType.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/DeploymentStatus.php b/src/Appwrite/Enums/DeploymentStatus.php index 930af809..34f9706b 100644 --- a/src/Appwrite/Enums/DeploymentStatus.php +++ b/src/Appwrite/Enums/DeploymentStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/EmbeddingModel.php b/src/Appwrite/Enums/EmbeddingModel.php index ec104ce9..3ffa7a7c 100644 --- a/src/Appwrite/Enums/EmbeddingModel.php +++ b/src/Appwrite/Enums/EmbeddingModel.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ExecutionMethod.php b/src/Appwrite/Enums/ExecutionMethod.php index b8a0c3d7..e8a9c82c 100644 --- a/src/Appwrite/Enums/ExecutionMethod.php +++ b/src/Appwrite/Enums/ExecutionMethod.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ExecutionResourceType.php b/src/Appwrite/Enums/ExecutionResourceType.php new file mode 100644 index 00000000..948e5619 --- /dev/null +++ b/src/Appwrite/Enums/ExecutionResourceType.php @@ -0,0 +1,52 @@ +value; + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function FUNCTIONS(): ExecutionResourceType + { + if (!isset(self::$FUNCTIONS)) { + self::$FUNCTIONS = new ExecutionResourceType('functions'); + } + return self::$FUNCTIONS; + } + public static function SITES(): ExecutionResourceType + { + if (!isset(self::$SITES)) { + self::$SITES = new ExecutionResourceType('sites'); + } + return self::$SITES; + } + + public static function from(string $value): self + { + return match ($value) { + 'functions' => self::FUNCTIONS(), + 'sites' => self::SITES(), + default => throw new \InvalidArgumentException('Unknown ExecutionResourceType value: ' . $value), + }; + } +} diff --git a/src/Appwrite/Enums/ExecutionStatus.php b/src/Appwrite/Enums/ExecutionStatus.php index efb2030a..c7cae79a 100644 --- a/src/Appwrite/Enums/ExecutionStatus.php +++ b/src/Appwrite/Enums/ExecutionStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ExecutionTrigger.php b/src/Appwrite/Enums/ExecutionTrigger.php index 64449f23..26487f49 100644 --- a/src/Appwrite/Enums/ExecutionTrigger.php +++ b/src/Appwrite/Enums/ExecutionTrigger.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Flag.php b/src/Appwrite/Enums/Flag.php index 0e6965dd..a4d6c501 100644 --- a/src/Appwrite/Enums/Flag.php +++ b/src/Appwrite/Enums/Flag.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Framework.php b/src/Appwrite/Enums/Framework.php index 2dd77c5f..6a620c7f 100644 --- a/src/Appwrite/Enums/Framework.php +++ b/src/Appwrite/Enums/Framework.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ImageFormat.php b/src/Appwrite/Enums/ImageFormat.php index 4b0a5414..7132ce5c 100644 --- a/src/Appwrite/Enums/ImageFormat.php +++ b/src/Appwrite/Enums/ImageFormat.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ImageGravity.php b/src/Appwrite/Enums/ImageGravity.php index a101dc18..384fc1a3 100644 --- a/src/Appwrite/Enums/ImageGravity.php +++ b/src/Appwrite/Enums/ImageGravity.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/IndexStatus.php b/src/Appwrite/Enums/IndexStatus.php index e36b6e28..fc079368 100644 --- a/src/Appwrite/Enums/IndexStatus.php +++ b/src/Appwrite/Enums/IndexStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/InvalidationType.php b/src/Appwrite/Enums/InvalidationType.php index 828bd90d..dd157618 100644 --- a/src/Appwrite/Enums/InvalidationType.php +++ b/src/Appwrite/Enums/InvalidationType.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/MessagePriority.php b/src/Appwrite/Enums/MessagePriority.php index a13ec24f..f08e7bf2 100644 --- a/src/Appwrite/Enums/MessagePriority.php +++ b/src/Appwrite/Enums/MessagePriority.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/MessageStatus.php b/src/Appwrite/Enums/MessageStatus.php index 15ce9f88..188c52a5 100644 --- a/src/Appwrite/Enums/MessageStatus.php +++ b/src/Appwrite/Enums/MessageStatus.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/MessagingProviderType.php b/src/Appwrite/Enums/MessagingProviderType.php index f5a7711b..012eed74 100644 --- a/src/Appwrite/Enums/MessagingProviderType.php +++ b/src/Appwrite/Enums/MessagingProviderType.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/OAuth2GooglePrompt.php b/src/Appwrite/Enums/OAuth2GooglePrompt.php index f6a6e876..5ed839f2 100644 --- a/src/Appwrite/Enums/OAuth2GooglePrompt.php +++ b/src/Appwrite/Enums/OAuth2GooglePrompt.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/OAuth2OidcPrompt.php b/src/Appwrite/Enums/OAuth2OidcPrompt.php index bbdad5ad..979febd4 100644 --- a/src/Appwrite/Enums/OAuth2OidcPrompt.php +++ b/src/Appwrite/Enums/OAuth2OidcPrompt.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/OAuthProvider.php b/src/Appwrite/Enums/OAuthProvider.php index decb1d46..0c8ab75a 100644 --- a/src/Appwrite/Enums/OAuthProvider.php +++ b/src/Appwrite/Enums/OAuthProvider.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string @@ -208,6 +209,13 @@ public static function GOOGLE(): OAuthProvider } return self::$GOOGLE; } + public static function HUGGINGFACE(): OAuthProvider + { + if (!isset(self::$HUGGINGFACE)) { + self::$HUGGINGFACE = new OAuthProvider('huggingface'); + } + return self::$HUGGINGFACE; + } public static function KEYCLOAK(): OAuthProvider { if (!isset(self::$KEYCLOAK)) { @@ -400,6 +408,7 @@ public static function from(string $value): self 'github' => self::GITHUB(), 'gitlab' => self::GITLAB(), 'google' => self::GOOGLE(), + 'huggingface' => self::HUGGINGFACE(), 'keycloak' => self::KEYCLOAK(), 'kick' => self::KICK(), 'linkedin' => self::LINKEDIN(), diff --git a/src/Appwrite/Enums/OrderBy.php b/src/Appwrite/Enums/OrderBy.php index ee63245a..c6060b32 100644 --- a/src/Appwrite/Enums/OrderBy.php +++ b/src/Appwrite/Enums/OrderBy.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/OrganizationKeyScopes.php b/src/Appwrite/Enums/OrganizationKeyScopes.php index 2d0e5d85..3b70fd28 100644 --- a/src/Appwrite/Enums/OrganizationKeyScopes.php +++ b/src/Appwrite/Enums/OrganizationKeyScopes.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/PasswordHash.php b/src/Appwrite/Enums/PasswordHash.php index 63de69b7..4ac4aba0 100644 --- a/src/Appwrite/Enums/PasswordHash.php +++ b/src/Appwrite/Enums/PasswordHash.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/PlatformType.php b/src/Appwrite/Enums/PlatformType.php index 4b1651a8..255ec616 100644 --- a/src/Appwrite/Enums/PlatformType.php +++ b/src/Appwrite/Enums/PlatformType.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectAuthMethodId.php b/src/Appwrite/Enums/ProjectAuthMethodId.php index c45572d4..46f1baca 100644 --- a/src/Appwrite/Enums/ProjectAuthMethodId.php +++ b/src/Appwrite/Enums/ProjectAuthMethodId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectEmailTemplateId.php b/src/Appwrite/Enums/ProjectEmailTemplateId.php index 58b14bda..1a2eb118 100644 --- a/src/Appwrite/Enums/ProjectEmailTemplateId.php +++ b/src/Appwrite/Enums/ProjectEmailTemplateId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectEmailTemplateLocale.php b/src/Appwrite/Enums/ProjectEmailTemplateLocale.php index 31971bb9..c8bfcfe5 100644 --- a/src/Appwrite/Enums/ProjectEmailTemplateLocale.php +++ b/src/Appwrite/Enums/ProjectEmailTemplateLocale.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectKeyScopes.php b/src/Appwrite/Enums/ProjectKeyScopes.php index a0c12987..1a7d9dbd 100644 --- a/src/Appwrite/Enums/ProjectKeyScopes.php +++ b/src/Appwrite/Enums/ProjectKeyScopes.php @@ -1,13 +1,17 @@ value = $value; } public function __toString(): string @@ -144,6 +143,13 @@ public static function PROJECTWRITE(): ProjectKeyScopes } return self::$PROJECTWRITE; } + public static function USAGEREAD(): ProjectKeyScopes + { + if (!isset(self::$USAGEREAD)) { + self::$USAGEREAD = new ProjectKeyScopes('usage.read'); + } + return self::$USAGEREAD; + } public static function KEYSREAD(): ProjectKeyScopes { if (!isset(self::$KEYSREAD)) { @@ -781,13 +787,6 @@ public static function RESTORATIONSWRITE(): ProjectKeyScopes } return self::$RESTORATIONSWRITE; } - public static function DEDICATEDDATABASESEXECUTE(): ProjectKeyScopes - { - if (!isset(self::$DEDICATEDDATABASESEXECUTE)) { - self::$DEDICATEDDATABASESEXECUTE = new ProjectKeyScopes('dedicatedDatabases.execute'); - } - return self::$DEDICATEDDATABASESEXECUTE; - } public static function DOMAINSREAD(): ProjectKeyScopes { if (!isset(self::$DOMAINSREAD)) { @@ -865,19 +864,13 @@ public static function OAUTH2INTROSPECT(): ProjectKeyScopes } return self::$OAUTH2INTROSPECT; } - public static function USAGEREAD(): ProjectKeyScopes - { - if (!isset(self::$USAGEREAD)) { - self::$USAGEREAD = new ProjectKeyScopes('usage.read'); - } - return self::$USAGEREAD; - } public static function from(string $value): self { return match ($value) { 'project.read' => self::PROJECTREAD(), 'project.write' => self::PROJECTWRITE(), + 'usage.read' => self::USAGEREAD(), 'keys.read' => self::KEYSREAD(), 'keys.write' => self::KEYSWRITE(), 'platforms.read' => self::PLATFORMSREAD(), @@ -969,7 +962,6 @@ public static function from(string $value): self 'archives.write' => self::ARCHIVESWRITE(), 'restorations.read' => self::RESTORATIONSREAD(), 'restorations.write' => self::RESTORATIONSWRITE(), - 'dedicatedDatabases.execute' => self::DEDICATEDDATABASESEXECUTE(), 'domains.read' => self::DOMAINSREAD(), 'domains.write' => self::DOMAINSWRITE(), 'wafRules.read' => self::WAFRULESREAD(), @@ -981,7 +973,6 @@ public static function from(string $value): self 'oauth2.read' => self::OAUTH2READ(), 'oauth2.write' => self::OAUTH2WRITE(), 'oauth2.introspect' => self::OAUTH2INTROSPECT(), - 'usage.read' => self::USAGEREAD(), default => throw new \InvalidArgumentException('Unknown ProjectKeyScopes value: ' . $value), }; } diff --git a/src/Appwrite/Enums/ProjectOAuth2GooglePrompt.php b/src/Appwrite/Enums/ProjectOAuth2GooglePrompt.php index d9e83492..bcff0b43 100644 --- a/src/Appwrite/Enums/ProjectOAuth2GooglePrompt.php +++ b/src/Appwrite/Enums/ProjectOAuth2GooglePrompt.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php b/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php index 867ee098..579084bc 100644 --- a/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php +++ b/src/Appwrite/Enums/ProjectOAuth2OidcPrompt.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectOAuthProviderId.php b/src/Appwrite/Enums/ProjectOAuthProviderId.php index 7f697114..2f838e78 100644 --- a/src/Appwrite/Enums/ProjectOAuthProviderId.php +++ b/src/Appwrite/Enums/ProjectOAuthProviderId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string @@ -208,6 +209,13 @@ public static function GOOGLE(): ProjectOAuthProviderId } return self::$GOOGLE; } + public static function HUGGINGFACE(): ProjectOAuthProviderId + { + if (!isset(self::$HUGGINGFACE)) { + self::$HUGGINGFACE = new ProjectOAuthProviderId('huggingface'); + } + return self::$HUGGINGFACE; + } public static function KEYCLOAK(): ProjectOAuthProviderId { if (!isset(self::$KEYCLOAK)) { @@ -400,6 +408,7 @@ public static function from(string $value): self 'github' => self::GITHUB(), 'gitlab' => self::GITLAB(), 'google' => self::GOOGLE(), + 'huggingface' => self::HUGGINGFACE(), 'keycloak' => self::KEYCLOAK(), 'kick' => self::KICK(), 'linkedin' => self::LINKEDIN(), diff --git a/src/Appwrite/Enums/ProjectPolicyId.php b/src/Appwrite/Enums/ProjectPolicyId.php index 7ee3c25d..575f8b4b 100644 --- a/src/Appwrite/Enums/ProjectPolicyId.php +++ b/src/Appwrite/Enums/ProjectPolicyId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectProtocolId.php b/src/Appwrite/Enums/ProjectProtocolId.php index c6d340c2..9dda1106 100644 --- a/src/Appwrite/Enums/ProjectProtocolId.php +++ b/src/Appwrite/Enums/ProjectProtocolId.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectSMTPSecure.php b/src/Appwrite/Enums/ProjectSMTPSecure.php index b53c9349..8a6d1b0f 100644 --- a/src/Appwrite/Enums/ProjectSMTPSecure.php +++ b/src/Appwrite/Enums/ProjectSMTPSecure.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProjectServiceId.php b/src/Appwrite/Enums/ProjectServiceId.php index 59921ae9..42ab4dbf 100644 --- a/src/Appwrite/Enums/ProjectServiceId.php +++ b/src/Appwrite/Enums/ProjectServiceId.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProxyResourceType.php b/src/Appwrite/Enums/ProxyResourceType.php index 65a0a1bd..d588cf80 100644 --- a/src/Appwrite/Enums/ProxyResourceType.php +++ b/src/Appwrite/Enums/ProxyResourceType.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProxyRuleDeploymentResourceType.php b/src/Appwrite/Enums/ProxyRuleDeploymentResourceType.php index 983314fc..c9b572ba 100644 --- a/src/Appwrite/Enums/ProxyRuleDeploymentResourceType.php +++ b/src/Appwrite/Enums/ProxyRuleDeploymentResourceType.php @@ -1,19 +1,19 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/ProxyRuleStatus.php b/src/Appwrite/Enums/ProxyRuleStatus.php index 8bac5eb8..b49ad0a3 100644 --- a/src/Appwrite/Enums/ProxyRuleStatus.php +++ b/src/Appwrite/Enums/ProxyRuleStatus.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Region.php b/src/Appwrite/Enums/Region.php index 7695a582..b0a7214f 100644 --- a/src/Appwrite/Enums/Region.php +++ b/src/Appwrite/Enums/Region.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/RelationMutate.php b/src/Appwrite/Enums/RelationMutate.php index 6e02d82e..fee5320b 100644 --- a/src/Appwrite/Enums/RelationMutate.php +++ b/src/Appwrite/Enums/RelationMutate.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/RelationshipType.php b/src/Appwrite/Enums/RelationshipType.php index f2d6e2e8..64a7e2ea 100644 --- a/src/Appwrite/Enums/RelationshipType.php +++ b/src/Appwrite/Enums/RelationshipType.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Runtime.php b/src/Appwrite/Enums/Runtime.php index d082cb86..f2ed8a42 100644 --- a/src/Appwrite/Enums/Runtime.php +++ b/src/Appwrite/Enums/Runtime.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string @@ -662,6 +663,13 @@ public static function BUN13(): Runtime } return self::$BUN13; } + public static function BUN14(): Runtime + { + if (!isset(self::$BUN14)) { + self::$BUN14 = new Runtime('bun-1.4'); + } + return self::$BUN14; + } public static function GO123(): Runtime { if (!isset(self::$GO123)) { @@ -842,6 +850,7 @@ public static function from(string $value): self 'bun-1.1' => self::BUN11(), 'bun-1.2' => self::BUN12(), 'bun-1.3' => self::BUN13(), + 'bun-1.4' => self::BUN14(), 'go-1.23' => self::GO123(), 'go-1.24' => self::GO124(), 'go-1.25' => self::GO125(), diff --git a/src/Appwrite/Enums/SmtpEncryption.php b/src/Appwrite/Enums/SmtpEncryption.php index 6f0e2f1e..fc5e6f82 100644 --- a/src/Appwrite/Enums/SmtpEncryption.php +++ b/src/Appwrite/Enums/SmtpEncryption.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/StatusCode.php b/src/Appwrite/Enums/StatusCode.php index 8a31157e..76dbda86 100644 --- a/src/Appwrite/Enums/StatusCode.php +++ b/src/Appwrite/Enums/StatusCode.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/TablesDBIndexType.php b/src/Appwrite/Enums/TablesDBIndexType.php index e9fa1747..32425eda 100644 --- a/src/Appwrite/Enums/TablesDBIndexType.php +++ b/src/Appwrite/Enums/TablesDBIndexType.php @@ -1,21 +1,21 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/TemplateReferenceType.php b/src/Appwrite/Enums/TemplateReferenceType.php index e81e29c7..765e85df 100644 --- a/src/Appwrite/Enums/TemplateReferenceType.php +++ b/src/Appwrite/Enums/TemplateReferenceType.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/Timezone.php b/src/Appwrite/Enums/Timezone.php index 47805f7b..532f4434 100644 --- a/src/Appwrite/Enums/Timezone.php +++ b/src/Appwrite/Enums/Timezone.php @@ -1,10 +1,13 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/Enums/VCSReferenceType.php b/src/Appwrite/Enums/VCSReferenceType.php index e47aa03b..582c7435 100644 --- a/src/Appwrite/Enums/VCSReferenceType.php +++ b/src/Appwrite/Enums/VCSReferenceType.php @@ -1,20 +1,20 @@ value = $value; } public function __toString(): string diff --git a/src/Appwrite/ID.php b/src/Appwrite/ID.php index 43db4c0d..7a9d8ee1 100644 --- a/src/Appwrite/ID.php +++ b/src/Appwrite/ID.php @@ -1,8 +1,11 @@ mimeType = $mimeType; $instance->filename = $filename; return $instance; - } + } public static function withData(string $data, ?string $mimeType = null, ?string $filename = null): InputFile { @@ -48,4 +50,4 @@ public static function withData(string $data, ?string $mimeType = null, ?string $instance->filename = $filename; return $instance; } -} \ No newline at end of file +} diff --git a/src/Appwrite/Models/ActivityEvent.php b/src/Appwrite/Models/ActivityEvent.php index 3bb7b87c..f1af42c6 100644 --- a/src/Appwrite/Models/ActivityEvent.php +++ b/src/Appwrite/Models/ActivityEvent.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'actorType' => static::serializeValue($this->actorType), 'actorId' => static::serializeValue($this->actorId), @@ -237,7 +241,5 @@ public function toArray(): array 'sdk' => static::serializeValue($this->sdk), 'sdkVersion' => static::serializeValue($this->sdkVersion) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ActivityEventList.php b/src/Appwrite/Models/ActivityEventList.php index 7039b9c6..191d993d 100644 --- a/src/Appwrite/Models/ActivityEventList.php +++ b/src/Appwrite/Models/ActivityEventList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'events' => static::serializeValue($this->events) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AdditionalResource.php b/src/Appwrite/Models/AdditionalResource.php index 22ccf01a..532bf02f 100644 --- a/src/Appwrite/Models/AdditionalResource.php +++ b/src/Appwrite/Models/AdditionalResource.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'unit' => static::serializeValue($this->unit), 'currency' => static::serializeValue($this->currency), @@ -76,7 +80,5 @@ public function toArray(): array 'value' => static::serializeValue($this->value), 'invoiceDesc' => static::serializeValue($this->invoiceDesc) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoArgon2.php b/src/Appwrite/Models/AlgoArgon2.php index aa6de2ee..c5acb0ab 100644 --- a/src/Appwrite/Models/AlgoArgon2.php +++ b/src/Appwrite/Models/AlgoArgon2.php @@ -1,9 +1,13 @@ static::serializeValue($this->type), 'memoryCost' => static::serializeValue($this->memoryCost), 'timeCost' => static::serializeValue($this->timeCost), 'threads' => static::serializeValue($this->threads) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoBcrypt.php b/src/Appwrite/Models/AlgoBcrypt.php index a2a1a945..a2a916bb 100644 --- a/src/Appwrite/Models/AlgoBcrypt.php +++ b/src/Appwrite/Models/AlgoBcrypt.php @@ -1,9 +1,13 @@ static::serializeValue($this->type) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoMd5.php b/src/Appwrite/Models/AlgoMd5.php index 06a1f851..3abcce42 100644 --- a/src/Appwrite/Models/AlgoMd5.php +++ b/src/Appwrite/Models/AlgoMd5.php @@ -1,9 +1,13 @@ static::serializeValue($this->type) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoPhpass.php b/src/Appwrite/Models/AlgoPhpass.php index 353f8809..9ce1b082 100644 --- a/src/Appwrite/Models/AlgoPhpass.php +++ b/src/Appwrite/Models/AlgoPhpass.php @@ -1,9 +1,13 @@ static::serializeValue($this->type) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoScrypt.php b/src/Appwrite/Models/AlgoScrypt.php index e602f313..fd2e3e39 100644 --- a/src/Appwrite/Models/AlgoScrypt.php +++ b/src/Appwrite/Models/AlgoScrypt.php @@ -1,9 +1,13 @@ static::serializeValue($this->type), 'costCpu' => static::serializeValue($this->costCpu), 'costMemory' => static::serializeValue($this->costMemory), 'costParallel' => static::serializeValue($this->costParallel), 'length' => static::serializeValue($this->length) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoScryptModified.php b/src/Appwrite/Models/AlgoScryptModified.php index c8018a36..20e306e4 100644 --- a/src/Appwrite/Models/AlgoScryptModified.php +++ b/src/Appwrite/Models/AlgoScryptModified.php @@ -1,9 +1,13 @@ static::serializeValue($this->type), 'salt' => static::serializeValue($this->salt), 'saltSeparator' => static::serializeValue($this->saltSeparator), 'signerKey' => static::serializeValue($this->signerKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AlgoSha.php b/src/Appwrite/Models/AlgoSha.php index 4da8de8c..69661214 100644 --- a/src/Appwrite/Models/AlgoSha.php +++ b/src/Appwrite/Models/AlgoSha.php @@ -1,9 +1,13 @@ static::serializeValue($this->type) ]; - - return $result; } } diff --git a/src/Appwrite/Models/App.php b/src/Appwrite/Models/App.php index c6d447ef..78e5c79a 100644 --- a/src/Appwrite/Models/App.php +++ b/src/Appwrite/Models/App.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -221,7 +225,5 @@ public function toArray(): array 'installationRedirectUrl' => static::serializeValue($this->installationRedirectUrl), 'secrets' => static::serializeValue($this->secrets) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppInstallation.php b/src/Appwrite/Models/AppInstallation.php index 1d13ce2f..ccb07f61 100644 --- a/src/Appwrite/Models/AppInstallation.php +++ b/src/Appwrite/Models/AppInstallation.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -101,7 +105,5 @@ public function toArray(): array 'createdByName' => static::serializeValue($this->createdByName), 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppInstallationList.php b/src/Appwrite/Models/AppInstallationList.php index 86a00699..9c03edc3 100644 --- a/src/Appwrite/Models/AppInstallationList.php +++ b/src/Appwrite/Models/AppInstallationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'installations' => static::serializeValue($this->installations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppKey.php b/src/Appwrite/Models/AppKey.php index 471de01f..49a44339 100644 --- a/src/Appwrite/Models/AppKey.php +++ b/src/Appwrite/Models/AppKey.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'createdByName' => static::serializeValue($this->createdByName), 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppKeyList.php b/src/Appwrite/Models/AppKeyList.php index a5753ead..47febab3 100644 --- a/src/Appwrite/Models/AppKeyList.php +++ b/src/Appwrite/Models/AppKeyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'keys' => static::serializeValue($this->keys) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppScope.php b/src/Appwrite/Models/AppScope.php index d0517995..2c34b679 100644 --- a/src/Appwrite/Models/AppScope.php +++ b/src/Appwrite/Models/AppScope.php @@ -1,9 +1,13 @@ static::serializeValue($this->value), 'description' => static::serializeValue($this->description), 'type' => static::serializeValue($this->type), 'category' => static::serializeValue($this->category), 'deprecated' => static::serializeValue($this->deprecated) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppScopeList.php b/src/Appwrite/Models/AppScopeList.php index 32090a96..09bf0e49 100644 --- a/src/Appwrite/Models/AppScopeList.php +++ b/src/Appwrite/Models/AppScopeList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'scopes' => static::serializeValue($this->scopes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppSecret.php b/src/Appwrite/Models/AppSecret.php index 5308587c..60d74c0b 100644 --- a/src/Appwrite/Models/AppSecret.php +++ b/src/Appwrite/Models/AppSecret.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'createdByName' => static::serializeValue($this->createdByName), 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppSecretList.php b/src/Appwrite/Models/AppSecretList.php index 2568f739..fe952101 100644 --- a/src/Appwrite/Models/AppSecretList.php +++ b/src/Appwrite/Models/AppSecretList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'secrets' => static::serializeValue($this->secrets) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppSecretPlaintext.php b/src/Appwrite/Models/AppSecretPlaintext.php index 35c321cb..3e44cd97 100644 --- a/src/Appwrite/Models/AppSecretPlaintext.php +++ b/src/Appwrite/Models/AppSecretPlaintext.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'createdByName' => static::serializeValue($this->createdByName), 'lastAccessedAt' => static::serializeValue($this->lastAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AppsList.php b/src/Appwrite/Models/AppsList.php index 547ab60d..08258206 100644 --- a/src/Appwrite/Models/AppsList.php +++ b/src/Appwrite/Models/AppsList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'apps' => static::serializeValue($this->apps) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ArraySerializable.php b/src/Appwrite/Models/ArraySerializable.php index b387f3cf..1aff26d0 100644 --- a/src/Appwrite/Models/ArraySerializable.php +++ b/src/Appwrite/Models/ArraySerializable.php @@ -1,5 +1,7 @@ $knownFields * @return array */ - private static function extractAdditionalPropertiesFromFields(array $data, array $knownFields): array + protected static function extractAdditionalPropertiesFromFields(array $data, array $knownFields): array { if (!\in_array('data', $knownFields, true) && isset($data['data']) && is_array($data['data'])) { return $data['data']; @@ -21,7 +23,7 @@ private static function extractAdditionalPropertiesFromFields(array $data, array /** * @return array */ - private static function serializeAdditionalProperties(mixed $value): array + protected static function serializeAdditionalProperties(mixed $value): array { if (!is_array($value)) { return []; @@ -36,7 +38,7 @@ private static function serializeAdditionalProperties(mixed $value): array return $result; } - private static function hydrateTypedValue(string $type, mixed $value, bool $allowsNull = false): mixed + protected static function hydrateTypedValue(string $type, mixed $value, bool $allowsNull = false): mixed { if ($value === null || !method_exists($type, 'from')) { return $value; @@ -49,7 +51,7 @@ private static function hydrateTypedValue(string $type, mixed $value, bool $allo return is_array($value) ? $type::from($value) : $type::from((string) $value); } - private static function serializeValue(mixed $value): mixed + protected static function serializeValue(mixed $value): mixed { if ($value === null) { return null; @@ -57,7 +59,7 @@ private static function serializeValue(mixed $value): mixed if (is_array($value)) { return array_map( - static fn (mixed $item): mixed => static::serializeValue($item), + static::serializeValue(...), $value ); } diff --git a/src/Appwrite/Models/AttributeBigint.php b/src/Appwrite/Models/AttributeBigint.php index bcd175c2..d82efa63 100644 --- a/src/Appwrite/Models/AttributeBigint.php +++ b/src/Appwrite/Models/AttributeBigint.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeBoolean.php b/src/Appwrite/Models/AttributeBoolean.php index a1ff7ce4..0f07edee 100644 --- a/src/Appwrite/Models/AttributeBoolean.php +++ b/src/Appwrite/Models/AttributeBoolean.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeDatetime.php b/src/Appwrite/Models/AttributeDatetime.php index ad7f5405..f5bdb09e 100644 --- a/src/Appwrite/Models/AttributeDatetime.php +++ b/src/Appwrite/Models/AttributeDatetime.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeEmail.php b/src/Appwrite/Models/AttributeEmail.php index c1da0b1b..40c7713d 100644 --- a/src/Appwrite/Models/AttributeEmail.php +++ b/src/Appwrite/Models/AttributeEmail.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeEnum.php b/src/Appwrite/Models/AttributeEnum.php index c6730f3b..2e787048 100644 --- a/src/Appwrite/Models/AttributeEnum.php +++ b/src/Appwrite/Models/AttributeEnum.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -107,7 +111,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeFloat.php b/src/Appwrite/Models/AttributeFloat.php index b319ed00..70dd498b 100644 --- a/src/Appwrite/Models/AttributeFloat.php +++ b/src/Appwrite/Models/AttributeFloat.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeInteger.php b/src/Appwrite/Models/AttributeInteger.php index 540a18bb..096bb3ae 100644 --- a/src/Appwrite/Models/AttributeInteger.php +++ b/src/Appwrite/Models/AttributeInteger.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeIp.php b/src/Appwrite/Models/AttributeIp.php index 13b19d06..f4b8cd2f 100644 --- a/src/Appwrite/Models/AttributeIp.php +++ b/src/Appwrite/Models/AttributeIp.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeLine.php b/src/Appwrite/Models/AttributeLine.php index 6867fc6c..c0b86b2a 100644 --- a/src/Appwrite/Models/AttributeLine.php +++ b/src/Appwrite/Models/AttributeLine.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeList.php b/src/Appwrite/Models/AttributeList.php index bb3ee377..851af79a 100644 --- a/src/Appwrite/Models/AttributeList.php +++ b/src/Appwrite/Models/AttributeList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'attributes' => static::serializeValue($this->attributes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeLongtext.php b/src/Appwrite/Models/AttributeLongtext.php index 6232eecd..ca6cdc7e 100644 --- a/src/Appwrite/Models/AttributeLongtext.php +++ b/src/Appwrite/Models/AttributeLongtext.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeMediumtext.php b/src/Appwrite/Models/AttributeMediumtext.php index 10aee46c..e0369578 100644 --- a/src/Appwrite/Models/AttributeMediumtext.php +++ b/src/Appwrite/Models/AttributeMediumtext.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributePoint.php b/src/Appwrite/Models/AttributePoint.php index 55bfb48a..36d4bacf 100644 --- a/src/Appwrite/Models/AttributePoint.php +++ b/src/Appwrite/Models/AttributePoint.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributePolygon.php b/src/Appwrite/Models/AttributePolygon.php index 50e512f0..6416edd1 100644 --- a/src/Appwrite/Models/AttributePolygon.php +++ b/src/Appwrite/Models/AttributePolygon.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeRelationship.php b/src/Appwrite/Models/AttributeRelationship.php index 571a692e..3ccb2c38 100644 --- a/src/Appwrite/Models/AttributeRelationship.php +++ b/src/Appwrite/Models/AttributeRelationship.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -131,7 +135,5 @@ public function toArray(): array 'onDelete' => static::serializeValue($this->onDelete), 'side' => static::serializeValue($this->side) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeString.php b/src/Appwrite/Models/AttributeString.php index 306bdeaf..51b74698 100644 --- a/src/Appwrite/Models/AttributeString.php +++ b/src/Appwrite/Models/AttributeString.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -104,7 +108,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeText.php b/src/Appwrite/Models/AttributeText.php index 3a0556ee..5efc568b 100644 --- a/src/Appwrite/Models/AttributeText.php +++ b/src/Appwrite/Models/AttributeText.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeUrl.php b/src/Appwrite/Models/AttributeUrl.php index d33d3b2a..3396b69d 100644 --- a/src/Appwrite/Models/AttributeUrl.php +++ b/src/Appwrite/Models/AttributeUrl.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/AttributeVarchar.php b/src/Appwrite/Models/AttributeVarchar.php index ad4c9857..cb8e0858 100644 --- a/src/Appwrite/Models/AttributeVarchar.php +++ b/src/Appwrite/Models/AttributeVarchar.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -104,7 +108,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupArchive.php b/src/Appwrite/Models/BackupArchive.php index 2a0fcfa5..f70d7a99 100644 --- a/src/Appwrite/Models/BackupArchive.php +++ b/src/Appwrite/Models/BackupArchive.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -112,7 +116,5 @@ public function toArray(): array 'resourceId' => static::serializeValue($this->resourceId), 'resourceType' => static::serializeValue($this->resourceType) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupArchiveList.php b/src/Appwrite/Models/BackupArchiveList.php index 7426257e..635f8ccd 100644 --- a/src/Appwrite/Models/BackupArchiveList.php +++ b/src/Appwrite/Models/BackupArchiveList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'archives' => static::serializeValue($this->archives) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupPolicy.php b/src/Appwrite/Models/BackupPolicy.php index 424f002c..1ccc459f 100644 --- a/src/Appwrite/Models/BackupPolicy.php +++ b/src/Appwrite/Models/BackupPolicy.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'name' => static::serializeValue($this->name), '$createdAt' => static::serializeValue($this->createdAt), @@ -112,7 +116,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupPolicyList.php b/src/Appwrite/Models/BackupPolicyList.php index 3189b4e2..0cc3171a 100644 --- a/src/Appwrite/Models/BackupPolicyList.php +++ b/src/Appwrite/Models/BackupPolicyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'policies' => static::serializeValue($this->policies) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupRestoration.php b/src/Appwrite/Models/BackupRestoration.php index c6d4e5be..7e43ad0b 100644 --- a/src/Appwrite/Models/BackupRestoration.php +++ b/src/Appwrite/Models/BackupRestoration.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -111,7 +115,5 @@ public function toArray(): array 'resources' => static::serializeValue($this->resources), 'options' => static::serializeValue($this->options) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BackupRestorationList.php b/src/Appwrite/Models/BackupRestorationList.php index 32537e79..707421f7 100644 --- a/src/Appwrite/Models/BackupRestorationList.php +++ b/src/Appwrite/Models/BackupRestorationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'restorations' => static::serializeValue($this->restorations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingLimits.php b/src/Appwrite/Models/BillingLimits.php index 83362ae4..580e88ea 100644 --- a/src/Appwrite/Models/BillingLimits.php +++ b/src/Appwrite/Models/BillingLimits.php @@ -1,9 +1,13 @@ static::serializeValue($this->bandwidth), 'storage' => static::serializeValue($this->storage), 'users' => static::serializeValue($this->users), @@ -66,7 +70,5 @@ public function toArray(): array 'authPhone' => static::serializeValue($this->authPhone), 'budgetLimit' => static::serializeValue($this->budgetLimit) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlan.php b/src/Appwrite/Models/BillingPlan.php index 3b7f783a..73d1a0d0 100644 --- a/src/Appwrite/Models/BillingPlan.php +++ b/src/Appwrite/Models/BillingPlan.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'name' => static::serializeValue($this->name), 'desc' => static::serializeValue($this->desc), @@ -478,6 +494,7 @@ public function toArray(): array 'supportsMockNumbers' => static::serializeValue($this->supportsMockNumbers), 'supportsOrganizationRoles' => static::serializeValue($this->supportsOrganizationRoles), 'supportsCredits' => static::serializeValue($this->supportsCredits), + 'supportsDedicatedDatabases' => static::serializeValue($this->supportsDedicatedDatabases), 'supportsDisposableEmailValidation' => static::serializeValue($this->supportsDisposableEmailValidation), 'supportsCanonicalEmailValidation' => static::serializeValue($this->supportsCanonicalEmailValidation), 'supportsFreeEmailValidation' => static::serializeValue($this->supportsFreeEmailValidation), @@ -493,9 +510,8 @@ public function toArray(): array 'limits' => static::serializeValue($this->limits), 'group' => static::serializeValue($this->group), 'program' => static::serializeValue($this->program), + 'databaseComputeCredit' => static::serializeValue($this->databaseComputeCredit), 'dedicatedDatabases' => static::serializeValue($this->dedicatedDatabases) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanAddon.php b/src/Appwrite/Models/BillingPlanAddon.php index f34340e5..9478e8cd 100644 --- a/src/Appwrite/Models/BillingPlanAddon.php +++ b/src/Appwrite/Models/BillingPlanAddon.php @@ -1,9 +1,13 @@ static::serializeValue($this->seats), 'projects' => static::serializeValue($this->projects) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanAddonDetails.php b/src/Appwrite/Models/BillingPlanAddonDetails.php index 79b8500c..cc972f38 100644 --- a/src/Appwrite/Models/BillingPlanAddonDetails.php +++ b/src/Appwrite/Models/BillingPlanAddonDetails.php @@ -1,9 +1,13 @@ static::serializeValue($this->supported), 'planIncluded' => static::serializeValue($this->planIncluded), 'limit' => static::serializeValue($this->limit), @@ -87,7 +91,5 @@ public function toArray(): array 'value' => static::serializeValue($this->value), 'invoiceDesc' => static::serializeValue($this->invoiceDesc) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php b/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php index 97a088b1..921c6d9d 100644 --- a/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php +++ b/src/Appwrite/Models/BillingPlanDedicatedDatabaseLimits.php @@ -1,9 +1,13 @@ static::serializeValue($this->minCpu), 'maxCpu' => static::serializeValue($this->maxCpu), 'minMemoryMb' => static::serializeValue($this->minMemoryMb), @@ -110,7 +114,5 @@ public function toArray(): array 'allowedStorageClasses' => static::serializeValue($this->allowedStorageClasses), 'allowedSyncModes' => static::serializeValue($this->allowedSyncModes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanLimits.php b/src/Appwrite/Models/BillingPlanLimits.php index 2f8d9d86..b45caba5 100644 --- a/src/Appwrite/Models/BillingPlanLimits.php +++ b/src/Appwrite/Models/BillingPlanLimits.php @@ -1,9 +1,13 @@ static::serializeValue($this->credits), 'dailyCredits' => static::serializeValue($this->dailyCredits) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BillingPlanSupportedAddons.php b/src/Appwrite/Models/BillingPlanSupportedAddons.php index 344ce998..0ecbe7bb 100644 --- a/src/Appwrite/Models/BillingPlanSupportedAddons.php +++ b/src/Appwrite/Models/BillingPlanSupportedAddons.php @@ -1,9 +1,13 @@ static::serializeValue($this->baa), 'premiumGeoDB' => static::serializeValue($this->premiumGeoDB), 'premiumGeoDBOrg' => static::serializeValue($this->premiumGeoDBOrg) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Block.php b/src/Appwrite/Models/Block.php index 4079f849..16f0841e 100644 --- a/src/Appwrite/Models/Block.php +++ b/src/Appwrite/Models/Block.php @@ -1,9 +1,13 @@ static::serializeValue($this->createdAt), 'resourceType' => static::serializeValue($this->resourceType), 'resourceId' => static::serializeValue($this->resourceId), @@ -105,7 +109,5 @@ public function toArray(): array 'organizationId' => static::serializeValue($this->organizationId), 'billingPlan' => static::serializeValue($this->billingPlan) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Bucket.php b/src/Appwrite/Models/Bucket.php index 50a2927c..b3589932 100644 --- a/src/Appwrite/Models/Bucket.php +++ b/src/Appwrite/Models/Bucket.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -132,7 +136,5 @@ public function toArray(): array 'transformations' => static::serializeValue($this->transformations), 'totalSize' => static::serializeValue($this->totalSize) ]; - - return $result; } } diff --git a/src/Appwrite/Models/BucketList.php b/src/Appwrite/Models/BucketList.php index 79edabbf..c94dc2e2 100644 --- a/src/Appwrite/Models/BucketList.php +++ b/src/Appwrite/Models/BucketList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'buckets' => static::serializeValue($this->buckets) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Collection.php b/src/Appwrite/Models/Collection.php index a5d8af5d..de2e7910 100644 --- a/src/Appwrite/Models/Collection.php +++ b/src/Appwrite/Models/Collection.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -123,7 +127,5 @@ public function toArray(): array 'bytesMax' => static::serializeValue($this->bytesMax), 'bytesUsed' => static::serializeValue($this->bytesUsed) ]; - - return $result; } } diff --git a/src/Appwrite/Models/CollectionList.php b/src/Appwrite/Models/CollectionList.php index de3a804a..3617db98 100644 --- a/src/Appwrite/Models/CollectionList.php +++ b/src/Appwrite/Models/CollectionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'collections' => static::serializeValue($this->collections) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnBigint.php b/src/Appwrite/Models/ColumnBigint.php index dcf0372b..34e70cfc 100644 --- a/src/Appwrite/Models/ColumnBigint.php +++ b/src/Appwrite/Models/ColumnBigint.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnBoolean.php b/src/Appwrite/Models/ColumnBoolean.php index 174c0ce9..7bbc0305 100644 --- a/src/Appwrite/Models/ColumnBoolean.php +++ b/src/Appwrite/Models/ColumnBoolean.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnDatetime.php b/src/Appwrite/Models/ColumnDatetime.php index 0596eda8..7eb241b5 100644 --- a/src/Appwrite/Models/ColumnDatetime.php +++ b/src/Appwrite/Models/ColumnDatetime.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnEmail.php b/src/Appwrite/Models/ColumnEmail.php index 5d5b77dd..f24369ed 100644 --- a/src/Appwrite/Models/ColumnEmail.php +++ b/src/Appwrite/Models/ColumnEmail.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnEnum.php b/src/Appwrite/Models/ColumnEnum.php index 748df535..925a656b 100644 --- a/src/Appwrite/Models/ColumnEnum.php +++ b/src/Appwrite/Models/ColumnEnum.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -107,7 +111,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnFloat.php b/src/Appwrite/Models/ColumnFloat.php index 5ccc00ee..c446e11a 100644 --- a/src/Appwrite/Models/ColumnFloat.php +++ b/src/Appwrite/Models/ColumnFloat.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnIndex.php b/src/Appwrite/Models/ColumnIndex.php index d46c91d4..2ef80f49 100644 --- a/src/Appwrite/Models/ColumnIndex.php +++ b/src/Appwrite/Models/ColumnIndex.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -101,7 +105,5 @@ public function toArray(): array 'lengths' => static::serializeValue($this->lengths), 'orders' => static::serializeValue($this->orders) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnIndexList.php b/src/Appwrite/Models/ColumnIndexList.php index 893e04f7..a5107ea5 100644 --- a/src/Appwrite/Models/ColumnIndexList.php +++ b/src/Appwrite/Models/ColumnIndexList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'indexes' => static::serializeValue($this->indexes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnInteger.php b/src/Appwrite/Models/ColumnInteger.php index 1782d1c8..e0bb2706 100644 --- a/src/Appwrite/Models/ColumnInteger.php +++ b/src/Appwrite/Models/ColumnInteger.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -101,7 +105,5 @@ public function toArray(): array 'max' => static::serializeValue($this->max), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnIp.php b/src/Appwrite/Models/ColumnIp.php index 48c658dc..a9d00a06 100644 --- a/src/Appwrite/Models/ColumnIp.php +++ b/src/Appwrite/Models/ColumnIp.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnLine.php b/src/Appwrite/Models/ColumnLine.php index 5c3b2ed0..93b337c8 100644 --- a/src/Appwrite/Models/ColumnLine.php +++ b/src/Appwrite/Models/ColumnLine.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnList.php b/src/Appwrite/Models/ColumnList.php index cccaa203..2c513f5d 100644 --- a/src/Appwrite/Models/ColumnList.php +++ b/src/Appwrite/Models/ColumnList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'columns' => static::serializeValue($this->columns) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnLongtext.php b/src/Appwrite/Models/ColumnLongtext.php index 07961098..7017212e 100644 --- a/src/Appwrite/Models/ColumnLongtext.php +++ b/src/Appwrite/Models/ColumnLongtext.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnMediumtext.php b/src/Appwrite/Models/ColumnMediumtext.php index feb94f18..9bea0bbc 100644 --- a/src/Appwrite/Models/ColumnMediumtext.php +++ b/src/Appwrite/Models/ColumnMediumtext.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnPoint.php b/src/Appwrite/Models/ColumnPoint.php index e626d146..92671a50 100644 --- a/src/Appwrite/Models/ColumnPoint.php +++ b/src/Appwrite/Models/ColumnPoint.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnPolygon.php b/src/Appwrite/Models/ColumnPolygon.php index fcfb0a4f..293e5df4 100644 --- a/src/Appwrite/Models/ColumnPolygon.php +++ b/src/Appwrite/Models/ColumnPolygon.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -93,7 +97,5 @@ public function toArray(): array '$updatedAt' => static::serializeValue($this->updatedAt), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnRelationship.php b/src/Appwrite/Models/ColumnRelationship.php index 05ea8fa2..71ce5770 100644 --- a/src/Appwrite/Models/ColumnRelationship.php +++ b/src/Appwrite/Models/ColumnRelationship.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -131,7 +135,5 @@ public function toArray(): array 'onDelete' => static::serializeValue($this->onDelete), 'side' => static::serializeValue($this->side) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnString.php b/src/Appwrite/Models/ColumnString.php index f93426f7..11e3fc95 100644 --- a/src/Appwrite/Models/ColumnString.php +++ b/src/Appwrite/Models/ColumnString.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -104,7 +108,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnText.php b/src/Appwrite/Models/ColumnText.php index 69cd4745..d8c265bc 100644 --- a/src/Appwrite/Models/ColumnText.php +++ b/src/Appwrite/Models/ColumnText.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -97,7 +101,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnUrl.php b/src/Appwrite/Models/ColumnUrl.php index 60d849e3..a2c66da5 100644 --- a/src/Appwrite/Models/ColumnUrl.php +++ b/src/Appwrite/Models/ColumnUrl.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -100,7 +104,5 @@ public function toArray(): array 'format' => static::serializeValue($this->format), 'default' => static::serializeValue($this->default) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ColumnVarchar.php b/src/Appwrite/Models/ColumnVarchar.php index 467b20bd..bb9ac368 100644 --- a/src/Appwrite/Models/ColumnVarchar.php +++ b/src/Appwrite/Models/ColumnVarchar.php @@ -1,11 +1,15 @@ static::serializeValue($this->key), 'type' => static::serializeValue($this->type), 'status' => static::serializeValue($this->status), @@ -104,7 +108,5 @@ public function toArray(): array 'default' => static::serializeValue($this->default), 'encrypt' => static::serializeValue($this->encrypt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Continent.php b/src/Appwrite/Models/Continent.php index ce841743..3b0084d5 100644 --- a/src/Appwrite/Models/Continent.php +++ b/src/Appwrite/Models/Continent.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'code' => static::serializeValue($this->code) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ContinentList.php b/src/Appwrite/Models/ContinentList.php index 33d61231..fdcc1705 100644 --- a/src/Appwrite/Models/ContinentList.php +++ b/src/Appwrite/Models/ContinentList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'continents' => static::serializeValue($this->continents) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Country.php b/src/Appwrite/Models/Country.php index 942ce59c..e41c058f 100644 --- a/src/Appwrite/Models/Country.php +++ b/src/Appwrite/Models/Country.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'code' => static::serializeValue($this->code) ]; - - return $result; } } diff --git a/src/Appwrite/Models/CountryList.php b/src/Appwrite/Models/CountryList.php index ee4b1eb5..ae208f01 100644 --- a/src/Appwrite/Models/CountryList.php +++ b/src/Appwrite/Models/CountryList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'countries' => static::serializeValue($this->countries) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Currency.php b/src/Appwrite/Models/Currency.php index 97aa3d91..87ee856f 100644 --- a/src/Appwrite/Models/Currency.php +++ b/src/Appwrite/Models/Currency.php @@ -1,9 +1,13 @@ static::serializeValue($this->symbol), 'name' => static::serializeValue($this->name), 'symbolNative' => static::serializeValue($this->symbolNative), @@ -83,7 +87,5 @@ public function toArray(): array 'code' => static::serializeValue($this->code), 'namePlural' => static::serializeValue($this->namePlural) ]; - - return $result; } } diff --git a/src/Appwrite/Models/CurrencyList.php b/src/Appwrite/Models/CurrencyList.php index 42fa537a..718ebae5 100644 --- a/src/Appwrite/Models/CurrencyList.php +++ b/src/Appwrite/Models/CurrencyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'currencies' => static::serializeValue($this->currencies) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Database.php b/src/Appwrite/Models/Database.php index b5e4baa0..62382d90 100644 --- a/src/Appwrite/Models/Database.php +++ b/src/Appwrite/Models/Database.php @@ -1,5 +1,7 @@ |null $policies database backup policies. * @param list|null $archives database backup archives. */ @@ -39,6 +46,9 @@ public function __construct( public ?string $engine = null, public ?string $specification = null, public ?int $replicas = null, + public ?string $error = null, + public ?string $containerStatus = null, + public ?string $lifecycleState = null, public ?array $policies = null, public ?array $archives = null ) { @@ -76,9 +86,12 @@ public static function from(array $data): static enabled: $data['enabled'], type: static::hydrateTypedValue(DatabaseType::class, $data['type']), status: array_key_exists('status', $data) ? static::hydrateTypedValue(DatabaseStatus::class, $data['status'], true) : null, - engine: array_key_exists('engine', $data) ? $data['engine'] : null, - specification: array_key_exists('specification', $data) ? $data['specification'] : null, - replicas: array_key_exists('replicas', $data) ? $data['replicas'] : null, + engine: $data['engine'] ?? null, + specification: $data['specification'] ?? null, + replicas: $data['replicas'] ?? null, + error: $data['error'] ?? null, + containerStatus: $data['containerStatus'] ?? null, + lifecycleState: $data['lifecycleState'] ?? null, policies: array_key_exists('policies', $data) ? ( is_array($data['policies']) @@ -107,7 +120,7 @@ public static function from(array $data): static */ public function toArray(): array { - $result = [ + return [ '$id' => static::serializeValue($this->id), 'name' => static::serializeValue($this->name), '$createdAt' => static::serializeValue($this->createdAt), @@ -118,10 +131,11 @@ public function toArray(): array 'engine' => static::serializeValue($this->engine), 'specification' => static::serializeValue($this->specification), 'replicas' => static::serializeValue($this->replicas), + 'error' => static::serializeValue($this->error), + 'containerStatus' => static::serializeValue($this->containerStatus), + 'lifecycleState' => static::serializeValue($this->lifecycleState), 'policies' => static::serializeValue($this->policies), 'archives' => static::serializeValue($this->archives) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseList.php b/src/Appwrite/Models/DatabaseList.php index bb164284..2f109442 100644 --- a/src/Appwrite/Models/DatabaseList.php +++ b/src/Appwrite/Models/DatabaseList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'databases' => static::serializeValue($this->databases) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseMigration.php b/src/Appwrite/Models/DatabaseMigration.php index d8e19ed8..3e2cce0e 100644 --- a/src/Appwrite/Models/DatabaseMigration.php +++ b/src/Appwrite/Models/DatabaseMigration.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -139,6 +149,7 @@ public function toArray(): array 'attempt' => static::serializeValue($this->attempt), 'lastError' => static::serializeValue($this->lastError), 'lagDocuments' => static::serializeValue($this->lagDocuments), + 'changelogWatermark' => static::serializeValue($this->changelogWatermark), 'verifiedAt' => static::serializeValue($this->verifiedAt), 'cutoverAt' => static::serializeValue($this->cutoverAt), 'soakUntil' => static::serializeValue($this->soakUntil), @@ -146,7 +157,5 @@ public function toArray(): array 'cutoverRequested' => static::serializeValue($this->cutoverRequested), 'paused' => static::serializeValue($this->paused) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseMigrationList.php b/src/Appwrite/Models/DatabaseMigrationList.php index d8016eaf..2fa2cfbb 100644 --- a/src/Appwrite/Models/DatabaseMigrationList.php +++ b/src/Appwrite/Models/DatabaseMigrationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'migrations' => static::serializeValue($this->migrations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseStatus.php b/src/Appwrite/Models/DatabaseStatus.php index 5408a15e..f2597558 100644 --- a/src/Appwrite/Models/DatabaseStatus.php +++ b/src/Appwrite/Models/DatabaseStatus.php @@ -1,9 +1,13 @@ static::serializeValue($this->health), 'ready' => static::serializeValue($this->ready), 'engine' => static::serializeValue($this->engine), @@ -136,7 +140,5 @@ public function toArray(): array 'replicas' => static::serializeValue($this->replicas), 'volumes' => static::serializeValue($this->volumes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseStatusConnections.php b/src/Appwrite/Models/DatabaseStatusConnections.php index da68a5b2..f0862f3c 100644 --- a/src/Appwrite/Models/DatabaseStatusConnections.php +++ b/src/Appwrite/Models/DatabaseStatusConnections.php @@ -1,9 +1,13 @@ static::serializeValue($this->current), 'max' => static::serializeValue($this->max) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseStatusReplica.php b/src/Appwrite/Models/DatabaseStatusReplica.php index 8c00b586..b313589f 100644 --- a/src/Appwrite/Models/DatabaseStatusReplica.php +++ b/src/Appwrite/Models/DatabaseStatusReplica.php @@ -1,9 +1,13 @@ static::serializeValue($this->index), 'role' => static::serializeValue($this->role), 'healthy' => static::serializeValue($this->healthy), + 'replicating' => static::serializeValue($this->replicating), 'lagSeconds' => static::serializeValue($this->lagSeconds) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DatabaseStatusVolume.php b/src/Appwrite/Models/DatabaseStatusVolume.php index 974ce9cf..a0f6aed7 100644 --- a/src/Appwrite/Models/DatabaseStatusVolume.php +++ b/src/Appwrite/Models/DatabaseStatusVolume.php @@ -1,9 +1,13 @@ static::serializeValue($this->path), 'usedPercent' => static::serializeValue($this->usedPercent), 'available' => static::serializeValue($this->available), 'mounted' => static::serializeValue($this->mounted) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabase.php b/src/Appwrite/Models/DedicatedDatabase.php index ce4706f6..a1560b58 100644 --- a/src/Appwrite/Models/DedicatedDatabase.php +++ b/src/Appwrite/Models/DedicatedDatabase.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -364,7 +368,5 @@ public function toArray(): array 'sqlApiTimeoutSeconds' => static::serializeValue($this->sqlApiTimeoutSeconds), 'error' => static::serializeValue($this->error) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseMember.php b/src/Appwrite/Models/DedicatedDatabaseMember.php index fb6dec1d..990c9093 100644 --- a/src/Appwrite/Models/DedicatedDatabaseMember.php +++ b/src/Appwrite/Models/DedicatedDatabaseMember.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'role' => static::serializeValue($this->role), 'status' => static::serializeValue($this->status), + 'replicating' => static::serializeValue($this->replicating), 'lagSeconds' => static::serializeValue($this->lagSeconds) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseOperation.php b/src/Appwrite/Models/DedicatedDatabaseOperation.php index 628b96a7..bee49abc 100644 --- a/src/Appwrite/Models/DedicatedDatabaseOperation.php +++ b/src/Appwrite/Models/DedicatedDatabaseOperation.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'databaseId' => static::serializeValue($this->databaseId), @@ -102,7 +106,5 @@ public function toArray(): array 'errorCode' => static::serializeValue($this->errorCode), 'errorMessage' => static::serializeValue($this->errorMessage) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseOperationList.php b/src/Appwrite/Models/DedicatedDatabaseOperationList.php index 0ee0c79d..9802ab1f 100644 --- a/src/Appwrite/Models/DedicatedDatabaseOperationList.php +++ b/src/Appwrite/Models/DedicatedDatabaseOperationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'operations' => static::serializeValue($this->operations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseReplicas.php b/src/Appwrite/Models/DedicatedDatabaseReplicas.php index f3728359..512864bb 100644 --- a/src/Appwrite/Models/DedicatedDatabaseReplicas.php +++ b/src/Appwrite/Models/DedicatedDatabaseReplicas.php @@ -1,9 +1,13 @@ static::serializeValue($this->replicas), 'syncMode' => static::serializeValue($this->syncMode), 'effectiveSyncMode' => static::serializeValue($this->effectiveSyncMode), @@ -89,7 +93,5 @@ public function toArray(): array 'syncStateConfirmed' => static::serializeValue($this->syncStateConfirmed), 'members' => static::serializeValue($this->members) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecification.php b/src/Appwrite/Models/DedicatedDatabaseSpecification.php index 5a1a5a29..d73bc7e3 100644 --- a/src/Appwrite/Models/DedicatedDatabaseSpecification.php +++ b/src/Appwrite/Models/DedicatedDatabaseSpecification.php @@ -1,9 +1,13 @@ static::serializeValue($this->slug), 'name' => static::serializeValue($this->name), 'price' => static::serializeValue($this->price), @@ -97,7 +101,5 @@ public function toArray(): array 'includedBandwidth' => static::serializeValue($this->includedBandwidth), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php b/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php index fb040cd3..a223990e 100644 --- a/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php +++ b/src/Appwrite/Models/DedicatedDatabaseSpecificationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->specifications), 'total' => static::serializeValue($this->total), 'pricing' => static::serializeValue($this->pricing) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php b/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php index 815757e2..c8a11f5f 100644 --- a/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php +++ b/src/Appwrite/Models/DedicatedDatabaseSpecificationPricing.php @@ -1,9 +1,13 @@ static::serializeValue($this->storageOverageRate), 'bandwidthOverageRate' => static::serializeValue($this->bandwidthOverageRate), 'replicaRate' => static::serializeValue($this->replicaRate), 'pitrRate' => static::serializeValue($this->pitrRate) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Deployment.php b/src/Appwrite/Models/Deployment.php index 702be010..b4d00c66 100644 --- a/src/Appwrite/Models/Deployment.php +++ b/src/Appwrite/Models/Deployment.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -225,7 +229,5 @@ public function toArray(): array 'providerBranch' => static::serializeValue($this->providerBranch), 'providerBranchUrl' => static::serializeValue($this->providerBranchUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DeploymentList.php b/src/Appwrite/Models/DeploymentList.php index adb27646..843c077e 100644 --- a/src/Appwrite/Models/DeploymentList.php +++ b/src/Appwrite/Models/DeploymentList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'deployments' => static::serializeValue($this->deployments) ]; - - return $result; } } diff --git a/src/Appwrite/Models/DevKey.php b/src/Appwrite/Models/DevKey.php index 24aa9908..971c16fa 100644 --- a/src/Appwrite/Models/DevKey.php +++ b/src/Appwrite/Models/DevKey.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -90,7 +94,5 @@ public function toArray(): array 'accessedAt' => static::serializeValue($this->accessedAt), 'sdks' => static::serializeValue($this->sdks) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Document.php b/src/Appwrite/Models/Document.php index 0aa44b25..c02e196c 100644 --- a/src/Appwrite/Models/Document.php +++ b/src/Appwrite/Models/Document.php @@ -1,16 +1,18 @@ static::serializeValue($this->total), 'documents' => static::serializeValue($this->documents) ]; - - return $result; } } diff --git a/src/Appwrite/Models/EmailTemplate.php b/src/Appwrite/Models/EmailTemplate.php index 0eb72fa6..6af65e24 100644 --- a/src/Appwrite/Models/EmailTemplate.php +++ b/src/Appwrite/Models/EmailTemplate.php @@ -1,9 +1,13 @@ static::serializeValue($this->templateId), 'locale' => static::serializeValue($this->locale), 'message' => static::serializeValue($this->message), @@ -90,7 +94,5 @@ public function toArray(): array 'replyToName' => static::serializeValue($this->replyToName), 'subject' => static::serializeValue($this->subject) ]; - - return $result; } } diff --git a/src/Appwrite/Models/EmailTemplateList.php b/src/Appwrite/Models/EmailTemplateList.php index a39660b0..0c2df1ee 100644 --- a/src/Appwrite/Models/EmailTemplateList.php +++ b/src/Appwrite/Models/EmailTemplateList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'templates' => static::serializeValue($this->templates) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Embedding.php b/src/Appwrite/Models/Embedding.php index c38c4787..b68d820f 100644 --- a/src/Appwrite/Models/Embedding.php +++ b/src/Appwrite/Models/Embedding.php @@ -1,9 +1,13 @@ static::serializeValue($this->model), 'dimension' => static::serializeValue($this->dimension), 'embedding' => static::serializeValue($this->embedding), 'error' => static::serializeValue($this->error) ]; - - return $result; } } diff --git a/src/Appwrite/Models/EmbeddingList.php b/src/Appwrite/Models/EmbeddingList.php index d666e5d5..029d802b 100644 --- a/src/Appwrite/Models/EmbeddingList.php +++ b/src/Appwrite/Models/EmbeddingList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'embeddings' => static::serializeValue($this->embeddings) ]; - - return $result; } } diff --git a/src/Appwrite/Models/EphemeralKey.php b/src/Appwrite/Models/EphemeralKey.php index 16729bec..a3823c45 100644 --- a/src/Appwrite/Models/EphemeralKey.php +++ b/src/Appwrite/Models/EphemeralKey.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -97,7 +101,5 @@ public function toArray(): array 'accessedAt' => static::serializeValue($this->accessedAt), 'sdks' => static::serializeValue($this->sdks) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Execution.php b/src/Appwrite/Models/Execution.php index 877f42a7..b95fab15 100644 --- a/src/Appwrite/Models/Execution.php +++ b/src/Appwrite/Models/Execution.php @@ -1,12 +1,17 @@ $requestHeaders http request headers as a key-value object. this will return only whitelisted headers. all headers are returned if execution is created as synchronous. * @param int $responseStatusCode http response status code. * @param string $responseBody http response body. this will return empty unless execution is created as synchronous. * @param list $responseHeaders http response headers as a key-value object. this will return only whitelisted headers. all headers are returned if execution is created as synchronous. - * @param string $logs function logs. includes the last 4,000 characters. this will return an empty string unless the response is returned using an api key or as part of a webhook payload. - * @param string $errors function errors. includes the last 4,000 characters. this will return an empty string unless the response is returned using an api key or as part of a webhook payload. + * @param string $logs resource logs. includes the last 4,000 characters. this will return an empty string unless the response is returned using an api key or as part of a webhook payload. + * @param string $errors resource errors. includes the last 4,000 characters. this will return an empty string unless the response is returned using an api key or as part of a webhook payload. * @param float $duration resource(function/site) execution duration in seconds. * @param string|null $scheduledAt the scheduled time for execution. if left empty, execution will be queued immediately. */ @@ -39,7 +45,8 @@ public function __construct( public string $createdAt, public string $updatedAt, public array $permissions, - public string $functionId, + public string $resourceId, + public ExecutionResourceType $resourceType, public string $deploymentId, public ExecutionTrigger $trigger, public ExecutionStatus $status, @@ -73,8 +80,11 @@ public static function from(array $data): static if (!array_key_exists('$permissions', $data)) { throw new \InvalidArgumentException('Missing required field "$permissions" for ' . static::class . '.'); } - if (!array_key_exists('functionId', $data)) { - throw new \InvalidArgumentException('Missing required field "functionId" for ' . static::class . '.'); + if (!array_key_exists('resourceId', $data)) { + throw new \InvalidArgumentException('Missing required field "resourceId" for ' . static::class . '.'); + } + if (!array_key_exists('resourceType', $data)) { + throw new \InvalidArgumentException('Missing required field "resourceType" for ' . static::class . '.'); } if (!array_key_exists('deploymentId', $data)) { throw new \InvalidArgumentException('Missing required field "deploymentId" for ' . static::class . '.'); @@ -118,7 +128,8 @@ public static function from(array $data): static createdAt: $data['$createdAt'], updatedAt: $data['$updatedAt'], permissions: $data['$permissions'], - functionId: $data['functionId'], + resourceId: $data['resourceId'], + resourceType: static::hydrateTypedValue(ExecutionResourceType::class, $data['resourceType']), deploymentId: $data['deploymentId'], trigger: static::hydrateTypedValue(ExecutionTrigger::class, $data['trigger']), status: static::hydrateTypedValue(ExecutionStatus::class, $data['status']), @@ -141,7 +152,7 @@ functionId: $data['functionId'], logs: $data['logs'], errors: $data['errors'], duration: $data['duration'], - scheduledAt: array_key_exists('scheduledAt', $data) ? $data['scheduledAt'] : null + scheduledAt: $data['scheduledAt'] ?? null ); } @@ -150,12 +161,13 @@ functionId: $data['functionId'], */ public function toArray(): array { - $result = [ + return [ '$id' => static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), '$permissions' => static::serializeValue($this->permissions), - 'functionId' => static::serializeValue($this->functionId), + 'resourceId' => static::serializeValue($this->resourceId), + 'resourceType' => static::serializeValue($this->resourceType), 'deploymentId' => static::serializeValue($this->deploymentId), 'trigger' => static::serializeValue($this->trigger), 'status' => static::serializeValue($this->status), @@ -170,7 +182,5 @@ public function toArray(): array 'duration' => static::serializeValue($this->duration), 'scheduledAt' => static::serializeValue($this->scheduledAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ExecutionList.php b/src/Appwrite/Models/ExecutionList.php index c9b4b04a..e2b8e14f 100644 --- a/src/Appwrite/Models/ExecutionList.php +++ b/src/Appwrite/Models/ExecutionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'executions' => static::serializeValue($this->executions) ]; - - return $result; } } diff --git a/src/Appwrite/Models/File.php b/src/Appwrite/Models/File.php index 4ce7c537..24304528 100644 --- a/src/Appwrite/Models/File.php +++ b/src/Appwrite/Models/File.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'bucketId' => static::serializeValue($this->bucketId), '$createdAt' => static::serializeValue($this->createdAt), @@ -146,7 +150,5 @@ public function toArray(): array 'encryption' => static::serializeValue($this->encryption), 'compression' => static::serializeValue($this->compression) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FileList.php b/src/Appwrite/Models/FileList.php index 2232f238..178e2d69 100644 --- a/src/Appwrite/Models/FileList.php +++ b/src/Appwrite/Models/FileList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'files' => static::serializeValue($this->files) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Framework.php b/src/Appwrite/Models/Framework.php index 04230237..ea4376e5 100644 --- a/src/Appwrite/Models/Framework.php +++ b/src/Appwrite/Models/Framework.php @@ -1,9 +1,13 @@ static::serializeValue($this->key), 'name' => static::serializeValue($this->name), 'buildRuntime' => static::serializeValue($this->buildRuntime), 'runtimes' => static::serializeValue($this->runtimes), 'adapters' => static::serializeValue($this->adapters) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FrameworkAdapter.php b/src/Appwrite/Models/FrameworkAdapter.php index a76a7110..b1e6b01e 100644 --- a/src/Appwrite/Models/FrameworkAdapter.php +++ b/src/Appwrite/Models/FrameworkAdapter.php @@ -1,9 +1,13 @@ static::serializeValue($this->key), 'installCommand' => static::serializeValue($this->installCommand), 'buildCommand' => static::serializeValue($this->buildCommand), 'outputDirectory' => static::serializeValue($this->outputDirectory), 'fallbackFile' => static::serializeValue($this->fallbackFile) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FrameworkList.php b/src/Appwrite/Models/FrameworkList.php index 42c11864..becb9ef9 100644 --- a/src/Appwrite/Models/FrameworkList.php +++ b/src/Appwrite/Models/FrameworkList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'frameworks' => static::serializeValue($this->frameworks) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FunctionList.php b/src/Appwrite/Models/FunctionList.php index c66430ec..6127a13e 100644 --- a/src/Appwrite/Models/FunctionList.php +++ b/src/Appwrite/Models/FunctionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'functions' => static::serializeValue($this->functions) ]; - - return $result; } } diff --git a/src/Appwrite/Models/FunctionModel.php b/src/Appwrite/Models/FunctionModel.php index fa68aa6b..48dd3e3d 100644 --- a/src/Appwrite/Models/FunctionModel.php +++ b/src/Appwrite/Models/FunctionModel.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -263,7 +267,5 @@ public function toArray(): array 'buildSpecification' => static::serializeValue($this->buildSpecification), 'runtimeSpecification' => static::serializeValue($this->runtimeSpecification) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Headers.php b/src/Appwrite/Models/Headers.php index afd48cef..548d7cff 100644 --- a/src/Appwrite/Models/Headers.php +++ b/src/Appwrite/Models/Headers.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'value' => static::serializeValue($this->value) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Identity.php b/src/Appwrite/Models/Identity.php index 16920c7e..7ce5e10b 100644 --- a/src/Appwrite/Models/Identity.php +++ b/src/Appwrite/Models/Identity.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -104,7 +108,5 @@ public function toArray(): array 'providerAccessTokenExpiry' => static::serializeValue($this->providerAccessTokenExpiry), 'providerRefreshToken' => static::serializeValue($this->providerRefreshToken) ]; - - return $result; } } diff --git a/src/Appwrite/Models/IdentityList.php b/src/Appwrite/Models/IdentityList.php index dece9ec9..f5b571bb 100644 --- a/src/Appwrite/Models/IdentityList.php +++ b/src/Appwrite/Models/IdentityList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'identities' => static::serializeValue($this->identities) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Index.php b/src/Appwrite/Models/Index.php index 39383747..4fb538ae 100644 --- a/src/Appwrite/Models/Index.php +++ b/src/Appwrite/Models/Index.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -103,7 +107,5 @@ public function toArray(): array 'lengths' => static::serializeValue($this->lengths), 'orders' => static::serializeValue($this->orders) ]; - - return $result; } } diff --git a/src/Appwrite/Models/IndexList.php b/src/Appwrite/Models/IndexList.php index 126f3b92..37a7c03d 100644 --- a/src/Appwrite/Models/IndexList.php +++ b/src/Appwrite/Models/IndexList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'indexes' => static::serializeValue($this->indexes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Insight.php b/src/Appwrite/Models/Insight.php index 84a73171..0692f83f 100644 --- a/src/Appwrite/Models/Insight.php +++ b/src/Appwrite/Models/Insight.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -149,7 +153,5 @@ public function toArray(): array 'dismissedAt' => static::serializeValue($this->dismissedAt), 'dismissedBy' => static::serializeValue($this->dismissedBy) ]; - - return $result; } } diff --git a/src/Appwrite/Models/InsightCTA.php b/src/Appwrite/Models/InsightCTA.php index b1b5bd68..303aae57 100644 --- a/src/Appwrite/Models/InsightCTA.php +++ b/src/Appwrite/Models/InsightCTA.php @@ -1,9 +1,13 @@ static::serializeValue($this->label), 'service' => static::serializeValue($this->service), 'method' => static::serializeValue($this->method), 'params' => static::serializeValue($this->params) ]; - - return $result; } } diff --git a/src/Appwrite/Models/InsightList.php b/src/Appwrite/Models/InsightList.php index d8dc4e66..c535a6ed 100644 --- a/src/Appwrite/Models/InsightList.php +++ b/src/Appwrite/Models/InsightList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'insights' => static::serializeValue($this->insights) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Jwt.php b/src/Appwrite/Models/Jwt.php index 80fcac52..6c544ee2 100644 --- a/src/Appwrite/Models/Jwt.php +++ b/src/Appwrite/Models/Jwt.php @@ -1,9 +1,13 @@ static::serializeValue($this->jwt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Key.php b/src/Appwrite/Models/Key.php index 3f2802ea..3f957a1a 100644 --- a/src/Appwrite/Models/Key.php +++ b/src/Appwrite/Models/Key.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -97,7 +101,5 @@ public function toArray(): array 'accessedAt' => static::serializeValue($this->accessedAt), 'sdks' => static::serializeValue($this->sdks) ]; - - return $result; } } diff --git a/src/Appwrite/Models/KeyList.php b/src/Appwrite/Models/KeyList.php index 3c297404..e17d4766 100644 --- a/src/Appwrite/Models/KeyList.php +++ b/src/Appwrite/Models/KeyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'keys' => static::serializeValue($this->keys) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Language.php b/src/Appwrite/Models/Language.php index 56ae4b3e..8c3b18bf 100644 --- a/src/Appwrite/Models/Language.php +++ b/src/Appwrite/Models/Language.php @@ -1,9 +1,13 @@ static::serializeValue($this->name), 'code' => static::serializeValue($this->code), 'nativeName' => static::serializeValue($this->nativeName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/LanguageList.php b/src/Appwrite/Models/LanguageList.php index 3756bb22..fb46caeb 100644 --- a/src/Appwrite/Models/LanguageList.php +++ b/src/Appwrite/Models/LanguageList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'languages' => static::serializeValue($this->languages) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Locale.php b/src/Appwrite/Models/Locale.php index e7ab2726..55c2ba92 100644 --- a/src/Appwrite/Models/Locale.php +++ b/src/Appwrite/Models/Locale.php @@ -1,9 +1,13 @@ static::serializeValue($this->ip), 'countryCode' => static::serializeValue($this->countryCode), 'country' => static::serializeValue($this->country), @@ -127,7 +131,5 @@ public function toArray(): array 'connectionUsageType' => static::serializeValue($this->connectionUsageType), 'connectionOrganization' => static::serializeValue($this->connectionOrganization) ]; - - return $result; } } diff --git a/src/Appwrite/Models/LocaleCode.php b/src/Appwrite/Models/LocaleCode.php index 6969516c..44699043 100644 --- a/src/Appwrite/Models/LocaleCode.php +++ b/src/Appwrite/Models/LocaleCode.php @@ -1,9 +1,13 @@ static::serializeValue($this->code), 'name' => static::serializeValue($this->name) ]; - - return $result; } } diff --git a/src/Appwrite/Models/LocaleCodeList.php b/src/Appwrite/Models/LocaleCodeList.php index 147f5180..c2b2a62e 100644 --- a/src/Appwrite/Models/LocaleCodeList.php +++ b/src/Appwrite/Models/LocaleCodeList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'localeCodes' => static::serializeValue($this->localeCodes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Log.php b/src/Appwrite/Models/Log.php index 8cb811db..01bfb02f 100644 --- a/src/Appwrite/Models/Log.php +++ b/src/Appwrite/Models/Log.php @@ -1,9 +1,13 @@ static::serializeValue($this->event), 'userId' => static::serializeValue($this->userId), 'userEmail' => static::serializeValue($this->userEmail), @@ -188,7 +192,5 @@ public function toArray(): array 'countryCode' => static::serializeValue($this->countryCode), 'countryName' => static::serializeValue($this->countryName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/LogList.php b/src/Appwrite/Models/LogList.php index 16291a55..944b82ca 100644 --- a/src/Appwrite/Models/LogList.php +++ b/src/Appwrite/Models/LogList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'logs' => static::serializeValue($this->logs) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Membership.php b/src/Appwrite/Models/Membership.php index 5f78877a..0887a74f 100644 --- a/src/Appwrite/Models/Membership.php +++ b/src/Appwrite/Models/Membership.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -139,7 +143,5 @@ public function toArray(): array 'userAccessedAt' => static::serializeValue($this->userAccessedAt), 'roles' => static::serializeValue($this->roles) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MembershipList.php b/src/Appwrite/Models/MembershipList.php index eb747649..713ff2cf 100644 --- a/src/Appwrite/Models/MembershipList.php +++ b/src/Appwrite/Models/MembershipList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'memberships' => static::serializeValue($this->memberships) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Message.php b/src/Appwrite/Models/Message.php index fd11026e..0a2d84b3 100644 --- a/src/Appwrite/Models/Message.php +++ b/src/Appwrite/Models/Message.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -118,7 +122,5 @@ public function toArray(): array 'data' => static::serializeValue($this->data), 'status' => static::serializeValue($this->status) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MessageList.php b/src/Appwrite/Models/MessageList.php index acc5788e..de505118 100644 --- a/src/Appwrite/Models/MessageList.php +++ b/src/Appwrite/Models/MessageList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'messages' => static::serializeValue($this->messages) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaChallenge.php b/src/Appwrite/Models/MfaChallenge.php index 695d72dc..cf630a67 100644 --- a/src/Appwrite/Models/MfaChallenge.php +++ b/src/Appwrite/Models/MfaChallenge.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'userId' => static::serializeValue($this->userId), 'expire' => static::serializeValue($this->expire) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaChallengeSecret.php b/src/Appwrite/Models/MfaChallengeSecret.php index 579080ae..d2eabe86 100644 --- a/src/Appwrite/Models/MfaChallengeSecret.php +++ b/src/Appwrite/Models/MfaChallengeSecret.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'userId' => static::serializeValue($this->userId), 'expire' => static::serializeValue($this->expire), 'code' => static::serializeValue($this->code) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaFactors.php b/src/Appwrite/Models/MfaFactors.php index eca5d042..638840d4 100644 --- a/src/Appwrite/Models/MfaFactors.php +++ b/src/Appwrite/Models/MfaFactors.php @@ -1,9 +1,13 @@ static::serializeValue($this->totp), 'phone' => static::serializeValue($this->phone), 'email' => static::serializeValue($this->email), 'recoveryCode' => static::serializeValue($this->recoveryCode), 'custom' => static::serializeValue($this->custom) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaRecoveryCodes.php b/src/Appwrite/Models/MfaRecoveryCodes.php index c63cfb5b..ea9e5533 100644 --- a/src/Appwrite/Models/MfaRecoveryCodes.php +++ b/src/Appwrite/Models/MfaRecoveryCodes.php @@ -1,9 +1,13 @@ static::serializeValue($this->recoveryCodes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MfaType.php b/src/Appwrite/Models/MfaType.php index 051c9c32..f4097590 100644 --- a/src/Appwrite/Models/MfaType.php +++ b/src/Appwrite/Models/MfaType.php @@ -1,9 +1,13 @@ static::serializeValue($this->secret), 'uri' => static::serializeValue($this->uri) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MockNumber.php b/src/Appwrite/Models/MockNumber.php index 2bbb1814..1ef79997 100644 --- a/src/Appwrite/Models/MockNumber.php +++ b/src/Appwrite/Models/MockNumber.php @@ -1,9 +1,13 @@ static::serializeValue($this->number), 'otp' => static::serializeValue($this->otp), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/MockNumberList.php b/src/Appwrite/Models/MockNumberList.php index 1d47405f..106ce4e3 100644 --- a/src/Appwrite/Models/MockNumberList.php +++ b/src/Appwrite/Models/MockNumberList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'mockNumbers' => static::serializeValue($this->mockNumbers) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Amazon.php b/src/Appwrite/Models/OAuth2Amazon.php index 4b431fb7..35884ef5 100644 --- a/src/Appwrite/Models/OAuth2Amazon.php +++ b/src/Appwrite/Models/OAuth2Amazon.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Apple.php b/src/Appwrite/Models/OAuth2Apple.php index 3c7029bb..778fed67 100644 --- a/src/Appwrite/Models/OAuth2Apple.php +++ b/src/Appwrite/Models/OAuth2Apple.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'serviceId' => static::serializeValue($this->serviceId), @@ -76,7 +80,5 @@ public function toArray(): array 'teamId' => static::serializeValue($this->teamId), 'p8File' => static::serializeValue($this->p8File) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Appwrite.php b/src/Appwrite/Models/OAuth2Appwrite.php index 1ae1b35a..4c9c3225 100644 --- a/src/Appwrite/Models/OAuth2Appwrite.php +++ b/src/Appwrite/Models/OAuth2Appwrite.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Auth0.php b/src/Appwrite/Models/OAuth2Auth0.php index 8c72ff7e..0c47d143 100644 --- a/src/Appwrite/Models/OAuth2Auth0.php +++ b/src/Appwrite/Models/OAuth2Auth0.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Authentik.php b/src/Appwrite/Models/OAuth2Authentik.php index c939589d..2cc6a7d3 100644 --- a/src/Appwrite/Models/OAuth2Authentik.php +++ b/src/Appwrite/Models/OAuth2Authentik.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Autodesk.php b/src/Appwrite/Models/OAuth2Autodesk.php index ea2067be..5be4ac9f 100644 --- a/src/Appwrite/Models/OAuth2Autodesk.php +++ b/src/Appwrite/Models/OAuth2Autodesk.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Bitbucket.php b/src/Appwrite/Models/OAuth2Bitbucket.php index f1a6e42f..bef81cf4 100644 --- a/src/Appwrite/Models/OAuth2Bitbucket.php +++ b/src/Appwrite/Models/OAuth2Bitbucket.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'key' => static::serializeValue($this->key), 'secret' => static::serializeValue($this->secret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Bitly.php b/src/Appwrite/Models/OAuth2Bitly.php index 8dd8ab8a..c315fbea 100644 --- a/src/Appwrite/Models/OAuth2Bitly.php +++ b/src/Appwrite/Models/OAuth2Bitly.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Box.php b/src/Appwrite/Models/OAuth2Box.php index 7b4b14e6..92adcd4f 100644 --- a/src/Appwrite/Models/OAuth2Box.php +++ b/src/Appwrite/Models/OAuth2Box.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Dailymotion.php b/src/Appwrite/Models/OAuth2Dailymotion.php index 8bc52f6b..4fa40091 100644 --- a/src/Appwrite/Models/OAuth2Dailymotion.php +++ b/src/Appwrite/Models/OAuth2Dailymotion.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'apiKey' => static::serializeValue($this->apiKey), 'apiSecret' => static::serializeValue($this->apiSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Discord.php b/src/Appwrite/Models/OAuth2Discord.php index f9c1d5b3..7b99a738 100644 --- a/src/Appwrite/Models/OAuth2Discord.php +++ b/src/Appwrite/Models/OAuth2Discord.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Disqus.php b/src/Appwrite/Models/OAuth2Disqus.php index 1bc8367c..05560127 100644 --- a/src/Appwrite/Models/OAuth2Disqus.php +++ b/src/Appwrite/Models/OAuth2Disqus.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'publicKey' => static::serializeValue($this->publicKey), 'secretKey' => static::serializeValue($this->secretKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Dropbox.php b/src/Appwrite/Models/OAuth2Dropbox.php index b0474ab4..af477a69 100644 --- a/src/Appwrite/Models/OAuth2Dropbox.php +++ b/src/Appwrite/Models/OAuth2Dropbox.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'appKey' => static::serializeValue($this->appKey), 'appSecret' => static::serializeValue($this->appSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Etsy.php b/src/Appwrite/Models/OAuth2Etsy.php index 120cf59a..5b8242d3 100644 --- a/src/Appwrite/Models/OAuth2Etsy.php +++ b/src/Appwrite/Models/OAuth2Etsy.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'keyString' => static::serializeValue($this->keyString), 'sharedSecret' => static::serializeValue($this->sharedSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Facebook.php b/src/Appwrite/Models/OAuth2Facebook.php index 9a9e8adb..f3912238 100644 --- a/src/Appwrite/Models/OAuth2Facebook.php +++ b/src/Appwrite/Models/OAuth2Facebook.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'appId' => static::serializeValue($this->appId), 'appSecret' => static::serializeValue($this->appSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Figma.php b/src/Appwrite/Models/OAuth2Figma.php index 02eab723..d3ee4b85 100644 --- a/src/Appwrite/Models/OAuth2Figma.php +++ b/src/Appwrite/Models/OAuth2Figma.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2FusionAuth.php b/src/Appwrite/Models/OAuth2FusionAuth.php index 0e2a7042..98c639b8 100644 --- a/src/Appwrite/Models/OAuth2FusionAuth.php +++ b/src/Appwrite/Models/OAuth2FusionAuth.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Github.php b/src/Appwrite/Models/OAuth2Github.php index c103d864..e9e939c0 100644 --- a/src/Appwrite/Models/OAuth2Github.php +++ b/src/Appwrite/Models/OAuth2Github.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Gitlab.php b/src/Appwrite/Models/OAuth2Gitlab.php index 61b54587..8dd63025 100644 --- a/src/Appwrite/Models/OAuth2Gitlab.php +++ b/src/Appwrite/Models/OAuth2Gitlab.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'applicationId' => static::serializeValue($this->applicationId), 'secret' => static::serializeValue($this->secret), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Google.php b/src/Appwrite/Models/OAuth2Google.php index be1ab206..687f946c 100644 --- a/src/Appwrite/Models/OAuth2Google.php +++ b/src/Appwrite/Models/OAuth2Google.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret), 'prompt' => static::serializeValue($this->prompt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2HuggingFace.php b/src/Appwrite/Models/OAuth2HuggingFace.php new file mode 100644 index 00000000..44f6e011 --- /dev/null +++ b/src/Appwrite/Models/OAuth2HuggingFace.php @@ -0,0 +1,70 @@ + $data + */ + public static function from(array $data): static + { + if (!array_key_exists('$id', $data)) { + throw new \InvalidArgumentException('Missing required field "$id" for ' . static::class . '.'); + } + if (!array_key_exists('enabled', $data)) { + throw new \InvalidArgumentException('Missing required field "enabled" for ' . static::class . '.'); + } + if (!array_key_exists('clientId', $data)) { + throw new \InvalidArgumentException('Missing required field "clientId" for ' . static::class . '.'); + } + if (!array_key_exists('clientSecret', $data)) { + throw new \InvalidArgumentException('Missing required field "clientSecret" for ' . static::class . '.'); + } + + return new static( + id: $data['$id'], + enabled: $data['enabled'], + clientId: $data['clientId'], + clientSecret: $data['clientSecret'] + ); + } + + /** + * @return array + */ + public function toArray(): array + { + return [ + '$id' => static::serializeValue($this->id), + 'enabled' => static::serializeValue($this->enabled), + 'clientId' => static::serializeValue($this->clientId), + 'clientSecret' => static::serializeValue($this->clientSecret) + ]; + } +} diff --git a/src/Appwrite/Models/OAuth2Keycloak.php b/src/Appwrite/Models/OAuth2Keycloak.php index 8f7ca6d5..4c149cab 100644 --- a/src/Appwrite/Models/OAuth2Keycloak.php +++ b/src/Appwrite/Models/OAuth2Keycloak.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), @@ -76,7 +80,5 @@ public function toArray(): array 'endpoint' => static::serializeValue($this->endpoint), 'realmName' => static::serializeValue($this->realmName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Kick.php b/src/Appwrite/Models/OAuth2Kick.php index cbf58c7c..e9bcba0e 100644 --- a/src/Appwrite/Models/OAuth2Kick.php +++ b/src/Appwrite/Models/OAuth2Kick.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Linkedin.php b/src/Appwrite/Models/OAuth2Linkedin.php index e3676882..109d947d 100644 --- a/src/Appwrite/Models/OAuth2Linkedin.php +++ b/src/Appwrite/Models/OAuth2Linkedin.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'primaryClientSecret' => static::serializeValue($this->primaryClientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Microsoft.php b/src/Appwrite/Models/OAuth2Microsoft.php index dc086930..4de9c591 100644 --- a/src/Appwrite/Models/OAuth2Microsoft.php +++ b/src/Appwrite/Models/OAuth2Microsoft.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'applicationId' => static::serializeValue($this->applicationId), 'applicationSecret' => static::serializeValue($this->applicationSecret), 'tenant' => static::serializeValue($this->tenant) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Notion.php b/src/Appwrite/Models/OAuth2Notion.php index f2612124..055b5382 100644 --- a/src/Appwrite/Models/OAuth2Notion.php +++ b/src/Appwrite/Models/OAuth2Notion.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'oauthClientId' => static::serializeValue($this->oauthClientId), 'oauthClientSecret' => static::serializeValue($this->oauthClientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Oidc.php b/src/Appwrite/Models/OAuth2Oidc.php index 26a21ce1..f2021019 100644 --- a/src/Appwrite/Models/OAuth2Oidc.php +++ b/src/Appwrite/Models/OAuth2Oidc.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), @@ -108,7 +112,5 @@ public function toArray(): array 'prompt' => static::serializeValue($this->prompt), 'maxAge' => static::serializeValue($this->maxAge) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Okta.php b/src/Appwrite/Models/OAuth2Okta.php index 5ddd3f50..d2a252e3 100644 --- a/src/Appwrite/Models/OAuth2Okta.php +++ b/src/Appwrite/Models/OAuth2Okta.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), @@ -76,7 +80,5 @@ public function toArray(): array 'domain' => static::serializeValue($this->domain), 'authorizationServerId' => static::serializeValue($this->authorizationServerId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Paypal.php b/src/Appwrite/Models/OAuth2Paypal.php index fbe8ded0..db84e72a 100644 --- a/src/Appwrite/Models/OAuth2Paypal.php +++ b/src/Appwrite/Models/OAuth2Paypal.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'secretKey' => static::serializeValue($this->secretKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Podio.php b/src/Appwrite/Models/OAuth2Podio.php index 53d92cdf..edecdfc1 100644 --- a/src/Appwrite/Models/OAuth2Podio.php +++ b/src/Appwrite/Models/OAuth2Podio.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2ProviderList.php b/src/Appwrite/Models/OAuth2ProviderList.php index 91f22677..fb40014e 100644 --- a/src/Appwrite/Models/OAuth2ProviderList.php +++ b/src/Appwrite/Models/OAuth2ProviderList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'providers' => static::serializeValue($this->providers) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Salesforce.php b/src/Appwrite/Models/OAuth2Salesforce.php index 7c43e7b3..02244d4c 100644 --- a/src/Appwrite/Models/OAuth2Salesforce.php +++ b/src/Appwrite/Models/OAuth2Salesforce.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'customerKey' => static::serializeValue($this->customerKey), 'customerSecret' => static::serializeValue($this->customerSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Slack.php b/src/Appwrite/Models/OAuth2Slack.php index 15d38489..b53be944 100644 --- a/src/Appwrite/Models/OAuth2Slack.php +++ b/src/Appwrite/Models/OAuth2Slack.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Spotify.php b/src/Appwrite/Models/OAuth2Spotify.php index c632a878..b03ad821 100644 --- a/src/Appwrite/Models/OAuth2Spotify.php +++ b/src/Appwrite/Models/OAuth2Spotify.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Stripe.php b/src/Appwrite/Models/OAuth2Stripe.php index d779a8d5..d9fb9a2c 100644 --- a/src/Appwrite/Models/OAuth2Stripe.php +++ b/src/Appwrite/Models/OAuth2Stripe.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'apiSecretKey' => static::serializeValue($this->apiSecretKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Tradeshift.php b/src/Appwrite/Models/OAuth2Tradeshift.php index 1fda081e..d5becb06 100644 --- a/src/Appwrite/Models/OAuth2Tradeshift.php +++ b/src/Appwrite/Models/OAuth2Tradeshift.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'oauth2ClientId' => static::serializeValue($this->oauth2ClientId), 'oauth2ClientSecret' => static::serializeValue($this->oauth2ClientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Twitch.php b/src/Appwrite/Models/OAuth2Twitch.php index 0d003260..d931eac6 100644 --- a/src/Appwrite/Models/OAuth2Twitch.php +++ b/src/Appwrite/Models/OAuth2Twitch.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2WordPress.php b/src/Appwrite/Models/OAuth2WordPress.php index 4748f573..ce0d76ff 100644 --- a/src/Appwrite/Models/OAuth2WordPress.php +++ b/src/Appwrite/Models/OAuth2WordPress.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2X.php b/src/Appwrite/Models/OAuth2X.php index 0d63599b..f197b677 100644 --- a/src/Appwrite/Models/OAuth2X.php +++ b/src/Appwrite/Models/OAuth2X.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'customerKey' => static::serializeValue($this->customerKey), 'secretKey' => static::serializeValue($this->secretKey) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Yahoo.php b/src/Appwrite/Models/OAuth2Yahoo.php index 0d2fad34..1250e72a 100644 --- a/src/Appwrite/Models/OAuth2Yahoo.php +++ b/src/Appwrite/Models/OAuth2Yahoo.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Yandex.php b/src/Appwrite/Models/OAuth2Yandex.php index e2b43d52..76102249 100644 --- a/src/Appwrite/Models/OAuth2Yandex.php +++ b/src/Appwrite/Models/OAuth2Yandex.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Zoho.php b/src/Appwrite/Models/OAuth2Zoho.php index 73eab938..47dfabf1 100644 --- a/src/Appwrite/Models/OAuth2Zoho.php +++ b/src/Appwrite/Models/OAuth2Zoho.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/OAuth2Zoom.php b/src/Appwrite/Models/OAuth2Zoom.php index 34454121..21ebd869 100644 --- a/src/Appwrite/Models/OAuth2Zoom.php +++ b/src/Appwrite/Models/OAuth2Zoom.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled), 'clientId' => static::serializeValue($this->clientId), 'clientSecret' => static::serializeValue($this->clientSecret) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Approve.php b/src/Appwrite/Models/Oauth2Approve.php index e4f896d3..38e866b5 100644 --- a/src/Appwrite/Models/Oauth2Approve.php +++ b/src/Appwrite/Models/Oauth2Approve.php @@ -1,9 +1,13 @@ static::serializeValue($this->redirectUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Authorize.php b/src/Appwrite/Models/Oauth2Authorize.php index 4667084b..e5d9957d 100644 --- a/src/Appwrite/Models/Oauth2Authorize.php +++ b/src/Appwrite/Models/Oauth2Authorize.php @@ -1,9 +1,13 @@ static::serializeValue($this->grantId), 'redirectUrl' => static::serializeValue($this->redirectUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Consent.php b/src/Appwrite/Models/Oauth2Consent.php index 248995ec..22b11a08 100644 --- a/src/Appwrite/Models/Oauth2Consent.php +++ b/src/Appwrite/Models/Oauth2Consent.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -104,7 +108,5 @@ public function toArray(): array 'authorizationDetails' => static::serializeValue($this->authorizationDetails), 'expire' => static::serializeValue($this->expire) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2ConsentList.php b/src/Appwrite/Models/Oauth2ConsentList.php index e6b0da7b..f53d6af6 100644 --- a/src/Appwrite/Models/Oauth2ConsentList.php +++ b/src/Appwrite/Models/Oauth2ConsentList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'consents' => static::serializeValue($this->consents) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2ConsentToken.php b/src/Appwrite/Models/Oauth2ConsentToken.php index 1c363fb4..cb708cb2 100644 --- a/src/Appwrite/Models/Oauth2ConsentToken.php +++ b/src/Appwrite/Models/Oauth2ConsentToken.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -111,7 +115,5 @@ public function toArray(): array 'authorizationDetails' => static::serializeValue($this->authorizationDetails), 'expire' => static::serializeValue($this->expire) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2ConsentTokenList.php b/src/Appwrite/Models/Oauth2ConsentTokenList.php index d24f6382..a86ff2df 100644 --- a/src/Appwrite/Models/Oauth2ConsentTokenList.php +++ b/src/Appwrite/Models/Oauth2ConsentTokenList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'tokens' => static::serializeValue($this->tokens) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2DeviceAuthorization.php b/src/Appwrite/Models/Oauth2DeviceAuthorization.php index 6f295a44..f8dd64b4 100644 --- a/src/Appwrite/Models/Oauth2DeviceAuthorization.php +++ b/src/Appwrite/Models/Oauth2DeviceAuthorization.php @@ -1,9 +1,13 @@ static::serializeValue($this->deviceCode), 'user_code' => static::serializeValue($this->userCode), 'verification_uri' => static::serializeValue($this->verificationUri), @@ -76,7 +80,5 @@ public function toArray(): array 'expires_in' => static::serializeValue($this->expiresIn), 'interval' => static::serializeValue($this->interval) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Grant.php b/src/Appwrite/Models/Oauth2Grant.php index 4b8de2f9..0d0991c4 100644 --- a/src/Appwrite/Models/Oauth2Grant.php +++ b/src/Appwrite/Models/Oauth2Grant.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -118,7 +122,5 @@ public function toArray(): array 'authTime' => static::serializeValue($this->authTime), 'expire' => static::serializeValue($this->expire) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Organization.php b/src/Appwrite/Models/Oauth2Organization.php index 25a7dcff..d251fa22 100644 --- a/src/Appwrite/Models/Oauth2Organization.php +++ b/src/Appwrite/Models/Oauth2Organization.php @@ -1,9 +1,13 @@ static::serializeValue($this->id) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2OrganizationList.php b/src/Appwrite/Models/Oauth2OrganizationList.php index 2f29ee00..e7ca6867 100644 --- a/src/Appwrite/Models/Oauth2OrganizationList.php +++ b/src/Appwrite/Models/Oauth2OrganizationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'organizations' => static::serializeValue($this->organizations) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2PAR.php b/src/Appwrite/Models/Oauth2PAR.php index d6f7d677..07b21311 100644 --- a/src/Appwrite/Models/Oauth2PAR.php +++ b/src/Appwrite/Models/Oauth2PAR.php @@ -1,9 +1,13 @@ static::serializeValue($this->requestUri), 'expires_in' => static::serializeValue($this->expiresIn) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Project.php b/src/Appwrite/Models/Oauth2Project.php index e7f9725d..3919e543 100644 --- a/src/Appwrite/Models/Oauth2Project.php +++ b/src/Appwrite/Models/Oauth2Project.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'region' => static::serializeValue($this->region), 'endpoint' => static::serializeValue($this->endpoint) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2ProjectList.php b/src/Appwrite/Models/Oauth2ProjectList.php index efa948b8..b4aa53b4 100644 --- a/src/Appwrite/Models/Oauth2ProjectList.php +++ b/src/Appwrite/Models/Oauth2ProjectList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'projects' => static::serializeValue($this->projects) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Reject.php b/src/Appwrite/Models/Oauth2Reject.php index 57304a14..0db98197 100644 --- a/src/Appwrite/Models/Oauth2Reject.php +++ b/src/Appwrite/Models/Oauth2Reject.php @@ -1,9 +1,13 @@ static::serializeValue($this->redirectUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Oauth2Token.php b/src/Appwrite/Models/Oauth2Token.php index b9bbb593..53f0add4 100644 --- a/src/Appwrite/Models/Oauth2Token.php +++ b/src/Appwrite/Models/Oauth2Token.php @@ -1,9 +1,13 @@ static::serializeValue($this->accessToken), 'token_type' => static::serializeValue($this->tokenType), 'expires_in' => static::serializeValue($this->expiresIn), @@ -77,7 +81,5 @@ public function toArray(): array 'authorization_details' => static::serializeValue($this->authorizationDetails), 'id_token' => static::serializeValue($this->idToken) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Organization.php b/src/Appwrite/Models/Organization.php index 5eeef10d..92160ce5 100644 --- a/src/Appwrite/Models/Organization.php +++ b/src/Appwrite/Models/Organization.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -240,7 +244,5 @@ public function toArray(): array 'platform' => static::serializeValue($this->platform), 'projects' => static::serializeValue($this->projects) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Phone.php b/src/Appwrite/Models/Phone.php index f8c56c24..1c99fe93 100644 --- a/src/Appwrite/Models/Phone.php +++ b/src/Appwrite/Models/Phone.php @@ -1,9 +1,13 @@ static::serializeValue($this->code), 'countryCode' => static::serializeValue($this->countryCode), 'countryName' => static::serializeValue($this->countryName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PhoneList.php b/src/Appwrite/Models/PhoneList.php index afa2e30e..76d7227e 100644 --- a/src/Appwrite/Models/PhoneList.php +++ b/src/Appwrite/Models/PhoneList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'phones' => static::serializeValue($this->phones) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformAndroid.php b/src/Appwrite/Models/PlatformAndroid.php index 3994c7ca..48ace53b 100644 --- a/src/Appwrite/Models/PlatformAndroid.php +++ b/src/Appwrite/Models/PlatformAndroid.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'applicationId' => static::serializeValue($this->applicationId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformApple.php b/src/Appwrite/Models/PlatformApple.php index 5919d10d..610f8153 100644 --- a/src/Appwrite/Models/PlatformApple.php +++ b/src/Appwrite/Models/PlatformApple.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'bundleIdentifier' => static::serializeValue($this->bundleIdentifier) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformLinux.php b/src/Appwrite/Models/PlatformLinux.php index 5a456a12..64f3b0de 100644 --- a/src/Appwrite/Models/PlatformLinux.php +++ b/src/Appwrite/Models/PlatformLinux.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'packageName' => static::serializeValue($this->packageName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformList.php b/src/Appwrite/Models/PlatformList.php index cd6653f0..50513f56 100644 --- a/src/Appwrite/Models/PlatformList.php +++ b/src/Appwrite/Models/PlatformList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'platforms' => static::serializeValue($this->platforms) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformWeb.php b/src/Appwrite/Models/PlatformWeb.php index f21bf514..4f9d78a6 100644 --- a/src/Appwrite/Models/PlatformWeb.php +++ b/src/Appwrite/Models/PlatformWeb.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'hostname' => static::serializeValue($this->hostname) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PlatformWindows.php b/src/Appwrite/Models/PlatformWindows.php index 3e5ec245..107f7715 100644 --- a/src/Appwrite/Models/PlatformWindows.php +++ b/src/Appwrite/Models/PlatformWindows.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -78,7 +82,5 @@ public function toArray(): array 'type' => static::serializeValue($this->type), 'packageIdentifierName' => static::serializeValue($this->packageIdentifierName) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyDenyAliasedEmail.php b/src/Appwrite/Models/PolicyDenyAliasedEmail.php index 1bcd1d34..977ceb60 100644 --- a/src/Appwrite/Models/PolicyDenyAliasedEmail.php +++ b/src/Appwrite/Models/PolicyDenyAliasedEmail.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyDenyCorporateEmail.php b/src/Appwrite/Models/PolicyDenyCorporateEmail.php index 9a48fbf3..e756f82c 100644 --- a/src/Appwrite/Models/PolicyDenyCorporateEmail.php +++ b/src/Appwrite/Models/PolicyDenyCorporateEmail.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyDenyDisposableEmail.php b/src/Appwrite/Models/PolicyDenyDisposableEmail.php index 877bdab8..6fdb54ee 100644 --- a/src/Appwrite/Models/PolicyDenyDisposableEmail.php +++ b/src/Appwrite/Models/PolicyDenyDisposableEmail.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyDenyFreeEmail.php b/src/Appwrite/Models/PolicyDenyFreeEmail.php index 3894d62c..3db8231e 100644 --- a/src/Appwrite/Models/PolicyDenyFreeEmail.php +++ b/src/Appwrite/Models/PolicyDenyFreeEmail.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyList.php b/src/Appwrite/Models/PolicyList.php index 5258e808..f05ed52f 100644 --- a/src/Appwrite/Models/PolicyList.php +++ b/src/Appwrite/Models/PolicyList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'policies' => static::serializeValue($this->policies) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyMembershipPrivacy.php b/src/Appwrite/Models/PolicyMembershipPrivacy.php index 5c3423d1..db8ec85d 100644 --- a/src/Appwrite/Models/PolicyMembershipPrivacy.php +++ b/src/Appwrite/Models/PolicyMembershipPrivacy.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'userId' => static::serializeValue($this->userId), 'userEmail' => static::serializeValue($this->userEmail), @@ -83,7 +87,5 @@ public function toArray(): array 'userMFA' => static::serializeValue($this->userMFA), 'userAccessedAt' => static::serializeValue($this->userAccessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyMfaFactors.php b/src/Appwrite/Models/PolicyMfaFactors.php index 89b49271..e6eecd63 100644 --- a/src/Appwrite/Models/PolicyMfaFactors.php +++ b/src/Appwrite/Models/PolicyMfaFactors.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'totp' => static::serializeValue($this->totp), 'email' => static::serializeValue($this->email), 'phone' => static::serializeValue($this->phone), 'custom' => static::serializeValue($this->custom) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyPasswordDictionary.php b/src/Appwrite/Models/PolicyPasswordDictionary.php index e640be87..4b1c34c4 100644 --- a/src/Appwrite/Models/PolicyPasswordDictionary.php +++ b/src/Appwrite/Models/PolicyPasswordDictionary.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyPasswordHistory.php b/src/Appwrite/Models/PolicyPasswordHistory.php index 7192807a..d59a9f9e 100644 --- a/src/Appwrite/Models/PolicyPasswordHistory.php +++ b/src/Appwrite/Models/PolicyPasswordHistory.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'total' => static::serializeValue($this->total) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyPasswordPersonalData.php b/src/Appwrite/Models/PolicyPasswordPersonalData.php index 4637c56e..aad948c0 100644 --- a/src/Appwrite/Models/PolicyPasswordPersonalData.php +++ b/src/Appwrite/Models/PolicyPasswordPersonalData.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyPasswordStrength.php b/src/Appwrite/Models/PolicyPasswordStrength.php index 16a13f4a..4974fafd 100644 --- a/src/Appwrite/Models/PolicyPasswordStrength.php +++ b/src/Appwrite/Models/PolicyPasswordStrength.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'min' => static::serializeValue($this->min), 'uppercase' => static::serializeValue($this->uppercase), @@ -76,7 +80,5 @@ public function toArray(): array 'number' => static::serializeValue($this->number), 'symbols' => static::serializeValue($this->symbols) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicySessionAlert.php b/src/Appwrite/Models/PolicySessionAlert.php index 74939839..0b4126f1 100644 --- a/src/Appwrite/Models/PolicySessionAlert.php +++ b/src/Appwrite/Models/PolicySessionAlert.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicySessionDuration.php b/src/Appwrite/Models/PolicySessionDuration.php index a3f60b7b..d37938b3 100644 --- a/src/Appwrite/Models/PolicySessionDuration.php +++ b/src/Appwrite/Models/PolicySessionDuration.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'duration' => static::serializeValue($this->duration) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicySessionInvalidation.php b/src/Appwrite/Models/PolicySessionInvalidation.php index 9b6e1630..27ab89aa 100644 --- a/src/Appwrite/Models/PolicySessionInvalidation.php +++ b/src/Appwrite/Models/PolicySessionInvalidation.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicySessionLimit.php b/src/Appwrite/Models/PolicySessionLimit.php index 9055b3bc..94d8775a 100644 --- a/src/Appwrite/Models/PolicySessionLimit.php +++ b/src/Appwrite/Models/PolicySessionLimit.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'total' => static::serializeValue($this->total) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PolicyUserLimit.php b/src/Appwrite/Models/PolicyUserLimit.php index c3866462..abc120e7 100644 --- a/src/Appwrite/Models/PolicyUserLimit.php +++ b/src/Appwrite/Models/PolicyUserLimit.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'total' => static::serializeValue($this->total) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Preferences.php b/src/Appwrite/Models/Preferences.php index f52607cf..36dd26fa 100644 --- a/src/Appwrite/Models/Preferences.php +++ b/src/Appwrite/Models/Preferences.php @@ -1,16 +1,18 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -88,7 +92,5 @@ public function toArray(): array 'expiresAt' => static::serializeValue($this->expiresAt), 'metadata' => static::serializeValue($this->metadata) ]; - - return $result; } } diff --git a/src/Appwrite/Models/PresenceList.php b/src/Appwrite/Models/PresenceList.php index ef673505..7f35fe93 100644 --- a/src/Appwrite/Models/PresenceList.php +++ b/src/Appwrite/Models/PresenceList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'presences' => static::serializeValue($this->presences) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Program.php b/src/Appwrite/Models/Program.php index a6bdcd53..a2e8f6ff 100644 --- a/src/Appwrite/Models/Program.php +++ b/src/Appwrite/Models/Program.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'title' => static::serializeValue($this->title), 'description' => static::serializeValue($this->description), @@ -97,7 +101,5 @@ public function toArray(): array 'external' => static::serializeValue($this->external), 'billingPlanId' => static::serializeValue($this->billingPlanId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Project.php b/src/Appwrite/Models/Project.php index c63ab5bb..d8f551ab 100644 --- a/src/Appwrite/Models/Project.php +++ b/src/Appwrite/Models/Project.php @@ -1,9 +1,13 @@ $protocols list of protocols. * @param list $blocks project blocks information * @param string $consoleAccessedAt last time the project was accessed via console. used with plan's projectinactivitydays to determine if project is paused. - * @param bool $wafEnabled whether waf enforcement is enabled for the project. + * @param bool|null $wafEnabled whether waf enforcement is enabled for the project. * @param BillingLimits|null $billingLimits billing limits reached * @param bool|null $oAuth2ServerEnabled oauth2 server status * @param string|null $oAuth2ServerAuthorizationUrl oauth2 server authorization url @@ -87,7 +91,7 @@ public function __construct( public array $protocols, public array $blocks, public string $consoleAccessedAt, - public bool $wafEnabled, + public ?bool $wafEnabled = null, public ?BillingLimits $billingLimits = null, public ?bool $oAuth2ServerEnabled = null, public ?string $oAuth2ServerAuthorizationUrl = null, @@ -195,9 +199,6 @@ public static function from(array $data): static if (!array_key_exists('consoleAccessedAt', $data)) { throw new \InvalidArgumentException('Missing required field "consoleAccessedAt" for ' . static::class . '.'); } - if (!array_key_exists('wafEnabled', $data)) { - throw new \InvalidArgumentException('Missing required field "wafEnabled" for ' . static::class . '.'); - } return new static( id: $data['$id'], @@ -252,25 +253,25 @@ public static function from(array $data): static ) : $data['blocks'], consoleAccessedAt: $data['consoleAccessedAt'], - wafEnabled: $data['wafEnabled'], + wafEnabled: $data['wafEnabled'] ?? null, billingLimits: array_key_exists('billingLimits', $data) ? static::hydrateTypedValue(BillingLimits::class, $data['billingLimits'], true) : null, - oAuth2ServerEnabled: array_key_exists('oAuth2ServerEnabled', $data) ? $data['oAuth2ServerEnabled'] : null, - oAuth2ServerAuthorizationUrl: array_key_exists('oAuth2ServerAuthorizationUrl', $data) ? $data['oAuth2ServerAuthorizationUrl'] : null, - oAuth2ServerScopes: array_key_exists('oAuth2ServerScopes', $data) ? $data['oAuth2ServerScopes'] : null, - oAuth2ServerDefaultScopes: array_key_exists('oAuth2ServerDefaultScopes', $data) ? $data['oAuth2ServerDefaultScopes'] : null, - oAuth2ServerInstallationScopes: array_key_exists('oAuth2ServerInstallationScopes', $data) ? $data['oAuth2ServerInstallationScopes'] : null, - oAuth2ServerAuthorizationDetailsTypes: array_key_exists('oAuth2ServerAuthorizationDetailsTypes', $data) ? $data['oAuth2ServerAuthorizationDetailsTypes'] : null, - oAuth2ServerAccessTokenDuration: array_key_exists('oAuth2ServerAccessTokenDuration', $data) ? $data['oAuth2ServerAccessTokenDuration'] : null, - oAuth2ServerRefreshTokenDuration: array_key_exists('oAuth2ServerRefreshTokenDuration', $data) ? $data['oAuth2ServerRefreshTokenDuration'] : null, - oAuth2ServerPublicAccessTokenDuration: array_key_exists('oAuth2ServerPublicAccessTokenDuration', $data) ? $data['oAuth2ServerPublicAccessTokenDuration'] : null, - oAuth2ServerPublicRefreshTokenDuration: array_key_exists('oAuth2ServerPublicRefreshTokenDuration', $data) ? $data['oAuth2ServerPublicRefreshTokenDuration'] : null, - oAuth2ServerInstallationAccessTokenDuration: array_key_exists('oAuth2ServerInstallationAccessTokenDuration', $data) ? $data['oAuth2ServerInstallationAccessTokenDuration'] : null, - oAuth2ServerConfidentialPkce: array_key_exists('oAuth2ServerConfidentialPkce', $data) ? $data['oAuth2ServerConfidentialPkce'] : null, - oAuth2ServerVerificationUrl: array_key_exists('oAuth2ServerVerificationUrl', $data) ? $data['oAuth2ServerVerificationUrl'] : null, - oAuth2ServerUserCodeLength: array_key_exists('oAuth2ServerUserCodeLength', $data) ? $data['oAuth2ServerUserCodeLength'] : null, - oAuth2ServerUserCodeFormat: array_key_exists('oAuth2ServerUserCodeFormat', $data) ? $data['oAuth2ServerUserCodeFormat'] : null, - oAuth2ServerDeviceCodeDuration: array_key_exists('oAuth2ServerDeviceCodeDuration', $data) ? $data['oAuth2ServerDeviceCodeDuration'] : null, - oAuth2ServerDiscoveryUrl: array_key_exists('oAuth2ServerDiscoveryUrl', $data) ? $data['oAuth2ServerDiscoveryUrl'] : null + oAuth2ServerEnabled: $data['oAuth2ServerEnabled'] ?? null, + oAuth2ServerAuthorizationUrl: $data['oAuth2ServerAuthorizationUrl'] ?? null, + oAuth2ServerScopes: $data['oAuth2ServerScopes'] ?? null, + oAuth2ServerDefaultScopes: $data['oAuth2ServerDefaultScopes'] ?? null, + oAuth2ServerInstallationScopes: $data['oAuth2ServerInstallationScopes'] ?? null, + oAuth2ServerAuthorizationDetailsTypes: $data['oAuth2ServerAuthorizationDetailsTypes'] ?? null, + oAuth2ServerAccessTokenDuration: $data['oAuth2ServerAccessTokenDuration'] ?? null, + oAuth2ServerRefreshTokenDuration: $data['oAuth2ServerRefreshTokenDuration'] ?? null, + oAuth2ServerPublicAccessTokenDuration: $data['oAuth2ServerPublicAccessTokenDuration'] ?? null, + oAuth2ServerPublicRefreshTokenDuration: $data['oAuth2ServerPublicRefreshTokenDuration'] ?? null, + oAuth2ServerInstallationAccessTokenDuration: $data['oAuth2ServerInstallationAccessTokenDuration'] ?? null, + oAuth2ServerConfidentialPkce: $data['oAuth2ServerConfidentialPkce'] ?? null, + oAuth2ServerVerificationUrl: $data['oAuth2ServerVerificationUrl'] ?? null, + oAuth2ServerUserCodeLength: $data['oAuth2ServerUserCodeLength'] ?? null, + oAuth2ServerUserCodeFormat: $data['oAuth2ServerUserCodeFormat'] ?? null, + oAuth2ServerDeviceCodeDuration: $data['oAuth2ServerDeviceCodeDuration'] ?? null, + oAuth2ServerDiscoveryUrl: $data['oAuth2ServerDiscoveryUrl'] ?? null ); } @@ -279,7 +280,7 @@ public static function from(array $data): static */ public function toArray(): array { - $result = [ + return [ '$id' => static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -327,7 +328,5 @@ public function toArray(): array 'oAuth2ServerDeviceCodeDuration' => static::serializeValue($this->oAuth2ServerDeviceCodeDuration), 'oAuth2ServerDiscoveryUrl' => static::serializeValue($this->oAuth2ServerDiscoveryUrl) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProjectAuthMethod.php b/src/Appwrite/Models/ProjectAuthMethod.php index 2f5903c3..28759de9 100644 --- a/src/Appwrite/Models/ProjectAuthMethod.php +++ b/src/Appwrite/Models/ProjectAuthMethod.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProjectList.php b/src/Appwrite/Models/ProjectList.php index 1084c0eb..ec34ea00 100644 --- a/src/Appwrite/Models/ProjectList.php +++ b/src/Appwrite/Models/ProjectList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'projects' => static::serializeValue($this->projects) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProjectProtocol.php b/src/Appwrite/Models/ProjectProtocol.php index c5f7bd1f..285292b1 100644 --- a/src/Appwrite/Models/ProjectProtocol.php +++ b/src/Appwrite/Models/ProjectProtocol.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProjectService.php b/src/Appwrite/Models/ProjectService.php index 357ad854..e1fd286e 100644 --- a/src/Appwrite/Models/ProjectService.php +++ b/src/Appwrite/Models/ProjectService.php @@ -1,11 +1,15 @@ static::serializeValue($this->id), 'enabled' => static::serializeValue($this->enabled) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Provider.php b/src/Appwrite/Models/Provider.php index 0d40ad77..a0bd6113 100644 --- a/src/Appwrite/Models/Provider.php +++ b/src/Appwrite/Models/Provider.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'credentials' => static::serializeValue($this->credentials), 'options' => static::serializeValue($this->options) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProviderList.php b/src/Appwrite/Models/ProviderList.php index 0d71729c..6a13de52 100644 --- a/src/Appwrite/Models/ProviderList.php +++ b/src/Appwrite/Models/ProviderList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'providers' => static::serializeValue($this->providers) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProxyInvalidation.php b/src/Appwrite/Models/ProxyInvalidation.php index 6b35dfeb..d40cde52 100644 --- a/src/Appwrite/Models/ProxyInvalidation.php +++ b/src/Appwrite/Models/ProxyInvalidation.php @@ -1,9 +1,13 @@ static::serializeValue($this->domain), 'type' => static::serializeValue($this->type), 'reference' => static::serializeValue($this->reference), 'status' => static::serializeValue($this->status) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProxyRule.php b/src/Appwrite/Models/ProxyRule.php index 7c2ae6dc..948ec1d7 100644 --- a/src/Appwrite/Models/ProxyRule.php +++ b/src/Appwrite/Models/ProxyRule.php @@ -1,5 +1,7 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -139,7 +143,5 @@ public function toArray(): array 'logs' => static::serializeValue($this->logs), 'renewAt' => static::serializeValue($this->renewAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ProxyRuleList.php b/src/Appwrite/Models/ProxyRuleList.php index 5c5377ca..c86f84a6 100644 --- a/src/Appwrite/Models/ProxyRuleList.php +++ b/src/Appwrite/Models/ProxyRuleList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'rules' => static::serializeValue($this->rules) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Report.php b/src/Appwrite/Models/Report.php index d0301ab1..3b09e61a 100644 --- a/src/Appwrite/Models/Report.php +++ b/src/Appwrite/Models/Report.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -120,7 +124,5 @@ public function toArray(): array 'insights' => static::serializeValue($this->insights), 'analyzedAt' => static::serializeValue($this->analyzedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ReportList.php b/src/Appwrite/Models/ReportList.php index caf999e3..839cea7a 100644 --- a/src/Appwrite/Models/ReportList.php +++ b/src/Appwrite/Models/ReportList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'reports' => static::serializeValue($this->reports) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ResourceToken.php b/src/Appwrite/Models/ResourceToken.php index 5938f2e5..76b380de 100644 --- a/src/Appwrite/Models/ResourceToken.php +++ b/src/Appwrite/Models/ResourceToken.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'resourceId' => static::serializeValue($this->resourceId), @@ -83,7 +87,5 @@ public function toArray(): array 'secret' => static::serializeValue($this->secret), 'accessedAt' => static::serializeValue($this->accessedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/ResourceTokenList.php b/src/Appwrite/Models/ResourceTokenList.php index 9b43db3f..be6b50e6 100644 --- a/src/Appwrite/Models/ResourceTokenList.php +++ b/src/Appwrite/Models/ResourceTokenList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'tokens' => static::serializeValue($this->tokens) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Row.php b/src/Appwrite/Models/Row.php index 4a1749f4..45aaf8a9 100644 --- a/src/Appwrite/Models/Row.php +++ b/src/Appwrite/Models/Row.php @@ -1,16 +1,18 @@ static::serializeValue($this->total), 'rows' => static::serializeValue($this->rows) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Runtime.php b/src/Appwrite/Models/Runtime.php index fd311d20..349f5ead 100644 --- a/src/Appwrite/Models/Runtime.php +++ b/src/Appwrite/Models/Runtime.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), 'key' => static::serializeValue($this->key), 'name' => static::serializeValue($this->name), @@ -90,7 +94,5 @@ public function toArray(): array 'logo' => static::serializeValue($this->logo), 'supports' => static::serializeValue($this->supports) ]; - - return $result; } } diff --git a/src/Appwrite/Models/RuntimeList.php b/src/Appwrite/Models/RuntimeList.php index 183567b3..071c8dfe 100644 --- a/src/Appwrite/Models/RuntimeList.php +++ b/src/Appwrite/Models/RuntimeList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'runtimes' => static::serializeValue($this->runtimes) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Session.php b/src/Appwrite/Models/Session.php index 0713ee5e..c4eba764 100644 --- a/src/Appwrite/Models/Session.php +++ b/src/Appwrite/Models/Session.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -237,7 +241,5 @@ public function toArray(): array 'secret' => static::serializeValue($this->secret), 'mfaUpdatedAt' => static::serializeValue($this->mfaUpdatedAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/SessionList.php b/src/Appwrite/Models/SessionList.php index 4acd0772..c006f1a5 100644 --- a/src/Appwrite/Models/SessionList.php +++ b/src/Appwrite/Models/SessionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'sessions' => static::serializeValue($this->sessions) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Site.php b/src/Appwrite/Models/Site.php index 19fd5ecf..5adb2086 100644 --- a/src/Appwrite/Models/Site.php +++ b/src/Appwrite/Models/Site.php @@ -1,9 +1,13 @@ $vars site variables. * @param int $timeout site request timeout in seconds. * @param string $installCommand the install command used to install the site dependencies. @@ -64,6 +69,7 @@ public function __construct( public string $latestDeploymentId, public string $latestDeploymentCreatedAt, public string $latestDeploymentStatus, + public array $scopes, public array $vars, public int $timeout, public string $installCommand, @@ -138,6 +144,9 @@ public static function from(array $data): static if (!array_key_exists('latestDeploymentStatus', $data)) { throw new \InvalidArgumentException('Missing required field "latestDeploymentStatus" for ' . static::class . '.'); } + if (!array_key_exists('scopes', $data)) { + throw new \InvalidArgumentException('Missing required field "scopes" for ' . static::class . '.'); + } if (!array_key_exists('vars', $data)) { throw new \InvalidArgumentException('Missing required field "vars" for ' . static::class . '.'); } @@ -210,6 +219,7 @@ public static function from(array $data): static latestDeploymentId: $data['latestDeploymentId'], latestDeploymentCreatedAt: $data['latestDeploymentCreatedAt'], latestDeploymentStatus: $data['latestDeploymentStatus'], + scopes: $data['scopes'], vars: is_array($data['vars']) ? array_map( static fn (mixed $item): mixed => static::hydrateTypedValue(Variable::class, $item), @@ -241,7 +251,7 @@ public static function from(array $data): static */ public function toArray(): array { - $result = [ + return [ '$id' => static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -258,6 +268,7 @@ public function toArray(): array 'latestDeploymentId' => static::serializeValue($this->latestDeploymentId), 'latestDeploymentCreatedAt' => static::serializeValue($this->latestDeploymentCreatedAt), 'latestDeploymentStatus' => static::serializeValue($this->latestDeploymentStatus), + 'scopes' => static::serializeValue($this->scopes), 'vars' => static::serializeValue($this->vars), 'timeout' => static::serializeValue($this->timeout), 'installCommand' => static::serializeValue($this->installCommand), @@ -277,7 +288,5 @@ public function toArray(): array 'adapter' => static::serializeValue($this->adapter), 'fallbackFile' => static::serializeValue($this->fallbackFile) ]; - - return $result; } } diff --git a/src/Appwrite/Models/SiteList.php b/src/Appwrite/Models/SiteList.php index 93eac7b2..371d171c 100644 --- a/src/Appwrite/Models/SiteList.php +++ b/src/Appwrite/Models/SiteList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'sites' => static::serializeValue($this->sites) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Specification.php b/src/Appwrite/Models/Specification.php index d2b7d058..0790b192 100644 --- a/src/Appwrite/Models/Specification.php +++ b/src/Appwrite/Models/Specification.php @@ -1,9 +1,13 @@ static::serializeValue($this->memory), 'cpus' => static::serializeValue($this->cpus), 'enabled' => static::serializeValue($this->enabled), 'slug' => static::serializeValue($this->slug) ]; - - return $result; } } diff --git a/src/Appwrite/Models/SpecificationList.php b/src/Appwrite/Models/SpecificationList.php index ac2442d7..d699c842 100644 --- a/src/Appwrite/Models/SpecificationList.php +++ b/src/Appwrite/Models/SpecificationList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'specifications' => static::serializeValue($this->specifications) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Subscriber.php b/src/Appwrite/Models/Subscriber.php index 15793254..7efd6f0c 100644 --- a/src/Appwrite/Models/Subscriber.php +++ b/src/Appwrite/Models/Subscriber.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -97,7 +101,5 @@ public function toArray(): array 'topicId' => static::serializeValue($this->topicId), 'providerType' => static::serializeValue($this->providerType) ]; - - return $result; } } diff --git a/src/Appwrite/Models/SubscriberList.php b/src/Appwrite/Models/SubscriberList.php index 458f5798..03b3c32f 100644 --- a/src/Appwrite/Models/SubscriberList.php +++ b/src/Appwrite/Models/SubscriberList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'subscribers' => static::serializeValue($this->subscribers) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Table.php b/src/Appwrite/Models/Table.php index c8b6a60f..dce6d3a5 100644 --- a/src/Appwrite/Models/Table.php +++ b/src/Appwrite/Models/Table.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -123,7 +127,5 @@ public function toArray(): array 'bytesMax' => static::serializeValue($this->bytesMax), 'bytesUsed' => static::serializeValue($this->bytesUsed) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TableList.php b/src/Appwrite/Models/TableList.php index 587fbfae..994c11e1 100644 --- a/src/Appwrite/Models/TableList.php +++ b/src/Appwrite/Models/TableList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'tables' => static::serializeValue($this->tables) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Target.php b/src/Appwrite/Models/Target.php index b00b2298..00a4decb 100644 --- a/src/Appwrite/Models/Target.php +++ b/src/Appwrite/Models/Target.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -94,7 +98,5 @@ public function toArray(): array 'identifier' => static::serializeValue($this->identifier), 'expired' => static::serializeValue($this->expired) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TargetList.php b/src/Appwrite/Models/TargetList.php index d4db0a5f..fe5c10ac 100644 --- a/src/Appwrite/Models/TargetList.php +++ b/src/Appwrite/Models/TargetList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'targets' => static::serializeValue($this->targets) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Team.php b/src/Appwrite/Models/Team.php index 73e1c130..463418cf 100644 --- a/src/Appwrite/Models/Team.php +++ b/src/Appwrite/Models/Team.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -76,7 +80,5 @@ public function toArray(): array 'total' => static::serializeValue($this->total), 'prefs' => static::serializeValue($this->prefs) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TeamList.php b/src/Appwrite/Models/TeamList.php index 61db8d1c..02e2b53b 100644 --- a/src/Appwrite/Models/TeamList.php +++ b/src/Appwrite/Models/TeamList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'teams' => static::serializeValue($this->teams) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Token.php b/src/Appwrite/Models/Token.php index 55288933..2056faa6 100644 --- a/src/Appwrite/Models/Token.php +++ b/src/Appwrite/Models/Token.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), 'userId' => static::serializeValue($this->userId), @@ -76,7 +80,5 @@ public function toArray(): array 'expire' => static::serializeValue($this->expire), 'phrase' => static::serializeValue($this->phrase) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Topic.php b/src/Appwrite/Models/Topic.php index d10df72b..caa2fcff 100644 --- a/src/Appwrite/Models/Topic.php +++ b/src/Appwrite/Models/Topic.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -90,7 +94,5 @@ public function toArray(): array 'pushTotal' => static::serializeValue($this->pushTotal), 'subscribe' => static::serializeValue($this->subscribe) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TopicList.php b/src/Appwrite/Models/TopicList.php index e8c184e5..9cfdc2ec 100644 --- a/src/Appwrite/Models/TopicList.php +++ b/src/Appwrite/Models/TopicList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'topics' => static::serializeValue($this->topics) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Transaction.php b/src/Appwrite/Models/Transaction.php index 010651f7..ff65aa52 100644 --- a/src/Appwrite/Models/Transaction.php +++ b/src/Appwrite/Models/Transaction.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -76,7 +80,5 @@ public function toArray(): array 'operations' => static::serializeValue($this->operations), 'expiresAt' => static::serializeValue($this->expiresAt) ]; - - return $result; } } diff --git a/src/Appwrite/Models/TransactionList.php b/src/Appwrite/Models/TransactionList.php index 9ee090e5..539e4357 100644 --- a/src/Appwrite/Models/TransactionList.php +++ b/src/Appwrite/Models/TransactionList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'transactions' => static::serializeValue($this->transactions) ]; - - return $result; } } diff --git a/src/Appwrite/Models/UsageBillingPlan.php b/src/Appwrite/Models/UsageBillingPlan.php index 827e4d60..eb9cab99 100644 --- a/src/Appwrite/Models/UsageBillingPlan.php +++ b/src/Appwrite/Models/UsageBillingPlan.php @@ -1,9 +1,13 @@ static::serializeValue($this->bandwidth), 'executions' => static::serializeValue($this->executions), 'member' => static::serializeValue($this->member), @@ -102,7 +106,5 @@ public function toArray(): array 'imageTransformations' => static::serializeValue($this->imageTransformations), 'credits' => static::serializeValue($this->credits) ]; - - return $result; } } diff --git a/src/Appwrite/Models/User.php b/src/Appwrite/Models/User.php index a7decdcc..da0157ca 100644 --- a/src/Appwrite/Models/User.php +++ b/src/Appwrite/Models/User.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -191,7 +195,5 @@ public function toArray(): array 'impersonator' => static::serializeValue($this->impersonator), 'impersonatorUserId' => static::serializeValue($this->impersonatorUserId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/UserList.php b/src/Appwrite/Models/UserList.php index 89ba62de..fb77b479 100644 --- a/src/Appwrite/Models/UserList.php +++ b/src/Appwrite/Models/UserList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'users' => static::serializeValue($this->users) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Variable.php b/src/Appwrite/Models/Variable.php index c6d097b7..8fe97fab 100644 --- a/src/Appwrite/Models/Variable.php +++ b/src/Appwrite/Models/Variable.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -90,7 +94,5 @@ public function toArray(): array 'resourceType' => static::serializeValue($this->resourceType), 'resourceId' => static::serializeValue($this->resourceId) ]; - - return $result; } } diff --git a/src/Appwrite/Models/VariableList.php b/src/Appwrite/Models/VariableList.php index c56ae8d7..9522d7c8 100644 --- a/src/Appwrite/Models/VariableList.php +++ b/src/Appwrite/Models/VariableList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'variables' => static::serializeValue($this->variables) ]; - - return $result; } } diff --git a/src/Appwrite/Models/Webhook.php b/src/Appwrite/Models/Webhook.php index 9a1f089e..0c8c585c 100644 --- a/src/Appwrite/Models/Webhook.php +++ b/src/Appwrite/Models/Webhook.php @@ -1,9 +1,13 @@ static::serializeValue($this->id), '$createdAt' => static::serializeValue($this->createdAt), '$updatedAt' => static::serializeValue($this->updatedAt), @@ -125,7 +129,5 @@ public function toArray(): array 'logs' => static::serializeValue($this->logs), 'attempts' => static::serializeValue($this->attempts) ]; - - return $result; } } diff --git a/src/Appwrite/Models/WebhookList.php b/src/Appwrite/Models/WebhookList.php index a15aa5cf..c402119f 100644 --- a/src/Appwrite/Models/WebhookList.php +++ b/src/Appwrite/Models/WebhookList.php @@ -1,9 +1,13 @@ static::serializeValue($this->total), 'webhooks' => static::serializeValue($this->webhooks) ]; - - return $result; } } diff --git a/src/Appwrite/Operator.php b/src/Appwrite/Operator.php index ad3c961c..8a296677 100644 --- a/src/Appwrite/Operator.php +++ b/src/Appwrite/Operator.php @@ -1,5 +1,7 @@ method = $method; if (is_null($values) || is_array($values)) { $this->values = $values; @@ -33,7 +33,7 @@ public function __construct(string $method, $values = null) public function __toString(): string { - return json_encode($this); + return (string) json_encode($this); } public function jsonSerialize(): mixed @@ -47,9 +47,6 @@ public function jsonSerialize(): mixed /** * Increment * - * @param int|float $value - * @param int|float|null $max - * @return string */ public static function increment(int|float $value = 1, int|float|null $max = null): string { @@ -63,15 +60,12 @@ public static function increment(int|float $value = 1, int|float|null $max = nul if ($max !== null) { $values[] = $max; } - return (new Operator('increment', $values))->__toString(); + return new Operator('increment', $values)->__toString(); } /** * Decrement * - * @param int|float $value - * @param int|float|null $min - * @return string */ public static function decrement(int|float $value = 1, int|float|null $min = null): string { @@ -85,15 +79,12 @@ public static function decrement(int|float $value = 1, int|float|null $min = nul if ($min !== null) { $values[] = $min; } - return (new Operator('decrement', $values))->__toString(); + return new Operator('decrement', $values)->__toString(); } /** * Multiply * - * @param int|float $factor - * @param int|float|null $max - * @return string */ public static function multiply(int|float $factor, int|float|null $max = null): string { @@ -107,15 +98,12 @@ public static function multiply(int|float $factor, int|float|null $max = null): if ($max !== null) { $values[] = $max; } - return (new Operator('multiply', $values))->__toString(); + return new Operator('multiply', $values)->__toString(); } /** * Divide * - * @param int|float $divisor - * @param int|float|null $min - * @return string */ public static function divide(int|float $divisor, int|float|null $min = null): string { @@ -132,14 +120,12 @@ public static function divide(int|float $divisor, int|float|null $min = null): s if ($min !== null) { $values[] = $min; } - return (new Operator('divide', $values))->__toString(); + return new Operator('divide', $values)->__toString(); } /** * Modulo * - * @param int|float $divisor - * @return string */ public static function modulo(int|float $divisor): string { @@ -149,15 +135,12 @@ public static function modulo(int|float $divisor): string if ($divisor === 0 || $divisor === 0.0) { throw new \InvalidArgumentException('Divisor cannot be zero'); } - return (new Operator('modulo', [$divisor]))->__toString(); + return new Operator('modulo', [$divisor])->__toString(); } /** * Power * - * @param int|float $exponent - * @param int|float|null $max - * @return string */ public static function power(int|float $exponent, int|float|null $max = null): string { @@ -171,161 +154,133 @@ public static function power(int|float $exponent, int|float|null $max = null): s if ($max !== null) { $values[] = $max; } - return (new Operator('power', $values))->__toString(); + return new Operator('power', $values)->__toString(); } /** * Array Append * - * @param array $values - * @return string */ public static function arrayAppend(array $values): string { - return (new Operator('arrayAppend', $values))->__toString(); + return new Operator('arrayAppend', $values)->__toString(); } /** * Array Prepend * - * @param array $values - * @return string */ public static function arrayPrepend(array $values): string { - return (new Operator('arrayPrepend', $values))->__toString(); + return new Operator('arrayPrepend', $values)->__toString(); } /** * Array Insert * - * @param int $index - * @param mixed $value - * @return string */ public static function arrayInsert(int $index, mixed $value): string { - return (new Operator('arrayInsert', [$index, $value]))->__toString(); + return new Operator('arrayInsert', [$index, $value])->__toString(); } /** * Array Remove * - * @param mixed $value - * @return string */ public static function arrayRemove(mixed $value): string { - return (new Operator('arrayRemove', [$value]))->__toString(); + return new Operator('arrayRemove', [$value])->__toString(); } /** * Array Unique * - * @return string */ public static function arrayUnique(): string { - return (new Operator('arrayUnique', []))->__toString(); + return new Operator('arrayUnique', [])->__toString(); } /** * Array Intersect * - * @param array $values - * @return string */ public static function arrayIntersect(array $values): string { - return (new Operator('arrayIntersect', $values))->__toString(); + return new Operator('arrayIntersect', $values)->__toString(); } /** * Array Diff * - * @param array $values - * @return string */ public static function arrayDiff(array $values): string { - return (new Operator('arrayDiff', $values))->__toString(); + return new Operator('arrayDiff', $values)->__toString(); } /** * Array Filter * - * @param string $condition - * @param mixed $value - * @return string */ public static function arrayFilter(string $condition, mixed $value = null): string { $values = [$condition, $value]; - return (new Operator('arrayFilter', $values))->__toString(); + return new Operator('arrayFilter', $values)->__toString(); } /** * Concat * - * @param mixed $value - * @return string */ public static function stringConcat(mixed $value): string { - return (new Operator('stringConcat', [$value]))->__toString(); + return new Operator('stringConcat', [$value])->__toString(); } /** * Replace * - * @param string $search - * @param string $replace - * @return string */ public static function stringReplace(string $search, string $replace): string { - return (new Operator('stringReplace', [$search, $replace]))->__toString(); + return new Operator('stringReplace', [$search, $replace])->__toString(); } /** * Toggle * - * @return string */ public static function toggle(): string { - return (new Operator('toggle', []))->__toString(); + return new Operator('toggle', [])->__toString(); } /** * Date Add Days * - * @param int $days - * @return string */ public static function dateAddDays(int $days): string { - return (new Operator('dateAddDays', [$days]))->__toString(); + return new Operator('dateAddDays', [$days])->__toString(); } /** * Date Subtract Days * - * @param int $days - * @return string */ public static function dateSubDays(int $days): string { - return (new Operator('dateSubDays', [$days]))->__toString(); + return new Operator('dateSubDays', [$days])->__toString(); } /** * Date Set Now * - * @return string */ public static function dateSetNow(): string { - return (new Operator('dateSetNow', []))->__toString(); + return new Operator('dateSetNow', [])->__toString(); } } diff --git a/src/Appwrite/Permission.php b/src/Appwrite/Permission.php index 8c250e32..837ac164 100644 --- a/src/Appwrite/Permission.php +++ b/src/Appwrite/Permission.php @@ -1,5 +1,7 @@ method = $method; - $this->attribute = $attribute; - + if (is_null($values) || is_array($values)) { $this->values = $values; } else { $this->values = [$values]; } - } public function __toString(): string { - return json_encode($this); + return (string) json_encode($this); } public function jsonSerialize(): mixed @@ -38,231 +35,181 @@ public function jsonSerialize(): mixed /** * Equal * - * @param string $attribute - * @param mixed $value - * @return string */ public static function equal(string $attribute, mixed $value): string { - return (new Query('equal', $attribute, $value))->__toString(); + return new Query('equal', $attribute, $value)->__toString(); } /** * Not Equal * - * @param string $attribute - * @param mixed $value - * @return string */ public static function notEqual(string $attribute, mixed $value): string { - return (new Query('notEqual', $attribute, $value))->__toString(); + return new Query('notEqual', $attribute, $value)->__toString(); } /** * Less Than * - * @param string $attribute - * @param mixed $value - * @return string */ public static function lessThan(string $attribute, mixed $value): string { - return (new Query('lessThan', $attribute, $value))->__toString(); + return new Query('lessThan', $attribute, $value)->__toString(); } /** * Less Than or Equal * - * @param string $attribute - * @param mixed $value - * @return string */ public static function lessThanEqual(string $attribute, mixed $value): string { - return (new Query('lessThanEqual', $attribute, $value))->__toString(); + return new Query('lessThanEqual', $attribute, $value)->__toString(); } /** * Greater Than * - * @param string $attribute - * @param mixed $value - * @return string */ public static function greaterThan(string $attribute, mixed $value): string { - return (new Query('greaterThan', $attribute, $value))->__toString(); + return new Query('greaterThan', $attribute, $value)->__toString(); } /** * Greater Than or Equal * - * @param string $attribute - * @param mixed $value - * @return string */ public static function greaterThanEqual(string $attribute, mixed $value): string { - return (new Query('greaterThanEqual', $attribute, $value))->__toString(); + return new Query('greaterThanEqual', $attribute, $value)->__toString(); } /** * Search * - * @param string $attribute - * @param string $value - * @return string */ public static function search(string $attribute, string $value): string { - return (new Query('search', $attribute, $value))->__toString(); + return new Query('search', $attribute, $value)->__toString(); } /** * Is Null * - * @param string $attribute - * @return string */ public static function isNull(string $attribute): string { - return (new Query('isNull', $attribute, null))->__toString(); + return new Query('isNull', $attribute)->__toString(); } /** * Is Not Null * - * @param string $attribute - * @return string */ public static function isNotNull(string $attribute): string { - return (new Query('isNotNull', $attribute, null))->__toString(); + return new Query('isNotNull', $attribute)->__toString(); } /** * Between * - * @param string $attribute - * @param string|int|float $start - * @param string|int|float $end - * @return string */ public static function between(string $attribute, mixed $start, mixed $end): string { - return (new Query('between', $attribute, [$start, $end]))->__toString(); + return new Query('between', $attribute, [$start, $end])->__toString(); } /** * Starts With * - * @param string $attribute - * @param string $value - * @return string */ public static function startsWith(string $attribute, string $value): string { - return (new Query('startsWith', $attribute, $value))->__toString(); + return new Query('startsWith', $attribute, $value)->__toString(); } /** * Ends With * - * @param string $attribute - * @param string $value - * @return string */ public static function endsWith(string $attribute, string $value): string { - return (new Query('endsWith', $attribute, $value))->__toString(); + return new Query('endsWith', $attribute, $value)->__toString(); } /** * Select * - * @param array $attributes - * @return string */ public static function select(array $attributes): string { - return (new Query('select', null, $attributes))->__toString(); + return new Query('select', null, $attributes)->__toString(); } /** * Cursor After * - * @param string $documentId - * @return string */ public static function cursorAfter(string $documentId): string { - return (new Query('cursorAfter', null, $documentId))->__toString(); + return new Query('cursorAfter', null, $documentId)->__toString(); } /** * Cursor Before * - * @param string $documentId - * @return string */ public static function cursorBefore(string $documentId): string { - return (new Query('cursorBefore', null, $documentId))->__toString(); + return new Query('cursorBefore', null, $documentId)->__toString(); } /** * Order Asc * - * @param string $attribute - * @return string */ public static function orderAsc(string $attribute): string { - return (new Query('orderAsc', $attribute, null))->__toString(); + return new Query('orderAsc', $attribute)->__toString(); } /** * Order Desc * - * @param string $attribute - * @return string */ public static function orderDesc(string $attribute): string { - return (new Query('orderDesc', $attribute, null))->__toString(); + return new Query('orderDesc', $attribute)->__toString(); } /** * Order Random * - * @return string */ public static function orderRandom(): string { - return (new Query('orderRandom', null, null))->__toString(); + return new Query('orderRandom')->__toString(); } /** * Limit * - * @param int $limit - * @return string */ public static function limit(int $limit): string { - return (new Query('limit', null, $limit))->__toString(); + return new Query('limit', null, $limit)->__toString(); } /** * Offset * - * @param int $offset - * @return string */ public static function offset(int $offset): string { - return (new Query('offset', null, $offset))->__toString(); + return new Query('offset', null, $offset)->__toString(); } /** @@ -272,13 +219,10 @@ public static function offset(int $offset): string * For string attributes, checks if the string contains the substring. * * Note: For array attributes, use containsAny() or containsAll() instead. - * @param string $attribute - * @param mixed $value - * @return string */ public static function contains(string $attribute, $value): string { - return (new Query('contains', $attribute, $value))->__toString(); + return new Query('contains', $attribute, $value)->__toString(); } /** @@ -288,13 +232,10 @@ public static function contains(string $attribute, $value): string * For array and relationship attributes, matches documents where the attribute * contains at least one of the given values. * - * @param string $attribute - * @param array $value - * @return string */ public static function containsAny(string $attribute, array $value): string { - return (new Query('containsAny', $attribute, $value))->__toString(); + return new Query('containsAny', $attribute, $value)->__toString(); } /** @@ -304,115 +245,87 @@ public static function containsAny(string $attribute, array $value): string * For array and relationship attributes, matches documents where the attribute * contains every one of the given values. * - * @param string $attribute - * @param array $value - * @return string */ public static function containsAll(string $attribute, array $value): string { - return (new Query('containsAll', $attribute, $value))->__toString(); + return new Query('containsAll', $attribute, $value)->__toString(); } /** * Not Contains * - * @param string $attribute - * @param mixed $value - * @return string */ public static function notContains(string $attribute, $value): string { - return (new Query('notContains', $attribute, $value))->__toString(); + return new Query('notContains', $attribute, $value)->__toString(); } /** * Not Search * - * @param string $attribute - * @param string $value - * @return string */ public static function notSearch(string $attribute, string $value): string { - return (new Query('notSearch', $attribute, $value))->__toString(); + return new Query('notSearch', $attribute, $value)->__toString(); } /** * Not Between * - * @param string $attribute - * @param string|int|float $start - * @param string|int|float $end - * @return string */ public static function notBetween(string $attribute, mixed $start, mixed $end): string { - return (new Query('notBetween', $attribute, [$start, $end]))->__toString(); + return new Query('notBetween', $attribute, [$start, $end])->__toString(); } /** * Not Starts With * - * @param string $attribute - * @param string $value - * @return string */ public static function notStartsWith(string $attribute, string $value): string { - return (new Query('notStartsWith', $attribute, $value))->__toString(); + return new Query('notStartsWith', $attribute, $value)->__toString(); } /** * Not Ends With * - * @param string $attribute - * @param string $value - * @return string */ public static function notEndsWith(string $attribute, string $value): string { - return (new Query('notEndsWith', $attribute, $value))->__toString(); + return new Query('notEndsWith', $attribute, $value)->__toString(); } /** * Filter resources where attribute matches a regular expression pattern. * - * @param string $attribute The attribute to filter on. - * @param string $pattern The regular expression pattern to match. - * @return string */ public static function regex(string $attribute, string $pattern): string { - return (new Query('regex', $attribute, $pattern))->__toString(); + return new Query('regex', $attribute, $pattern)->__toString(); } /** * Filter resources where the specified attributes exist. * - * @param array $attributes The list of attributes that must exist. - * @return string */ public static function exists(array $attributes): string { - return (new Query('exists', null, $attributes))->__toString(); + return new Query('exists', null, $attributes)->__toString(); } /** * Filter resources where the specified attributes do not exist. * - * @param array $attributes The list of attributes that must not exist. - * @return string */ public static function notExists(array $attributes): string { - return (new Query('notExists', null, $attributes))->__toString(); + return new Query('notExists', null, $attributes)->__toString(); } /** * Created Before * - * @param string $value - * @return string */ public static function createdBefore(string $value): string { @@ -422,8 +335,6 @@ public static function createdBefore(string $value): string /** * Created After * - * @param string $value - * @return string */ public static function createdAfter(string $value): string { @@ -433,9 +344,6 @@ public static function createdAfter(string $value): string /** * Created Between * - * @param string $start - * @param string $end - * @return string */ public static function createdBetween(string $start, string $end): string { @@ -445,8 +353,6 @@ public static function createdBetween(string $start, string $end): string /** * Updated Before * - * @param string $value - * @return string */ public static function updatedBefore(string $value): string { @@ -456,8 +362,6 @@ public static function updatedBefore(string $value): string /** * Updated After * - * @param string $value - * @return string */ public static function updatedAfter(string $value): string { @@ -467,9 +371,6 @@ public static function updatedAfter(string $value): string /** * Updated Between * - * @param string $start - * @param string $end - * @return string */ public static function updatedBetween(string $start, string $end): string { @@ -479,37 +380,30 @@ public static function updatedBetween(string $start, string $end): string /** * Or * - * @param array $queries - * @return string */ public static function or(array $queries): string { foreach ($queries as &$query) { $query = \json_decode($query, true); } - return (new Query('or', null, $queries))->__toString(); + return new Query('or', null, $queries)->__toString(); } /** * And * - * @param array $queries - * @return string */ public static function and(array $queries): string { foreach ($queries as &$query) { $query = \json_decode($query, true); } - return (new Query('and', null, $queries))->__toString(); + return new Query('and', null, $queries)->__toString(); } /** * Filter array elements where at least one element matches all the specified queries. * - * @param string $attribute The attribute containing the array to filter on. - * @param array $queries The list of query strings to match against array elements. - * @return string */ public static function elemMatch(string $attribute, array $queries): string { @@ -517,191 +411,141 @@ public static function elemMatch(string $attribute, array $queries): string $query = \json_decode($query, true); } - return (new Query('elemMatch', $attribute, $queries))->__toString(); + return new Query('elemMatch', $attribute, $queries)->__toString(); } /** * Distance Equal * - * @param string $attribute - * @param array $values - * @param int|float $distance - * @return string */ public static function distanceEqual(string $attribute, array $values, int|float $distance, bool $meters = true): string { - return (new Query('distanceEqual', $attribute, [[$values, $distance, $meters]]))->__toString(); + return new Query('distanceEqual', $attribute, [[$values, $distance, $meters]])->__toString(); } /** * Distance Not Equal * - * @param string $attribute - * @param array $values - * @param int|float $distance - * @return string */ public static function distanceNotEqual(string $attribute, array $values, int|float $distance, bool $meters = true): string { - return (new Query('distanceNotEqual', $attribute, [[$values, $distance, $meters]]))->__toString(); + return new Query('distanceNotEqual', $attribute, [[$values, $distance, $meters]])->__toString(); } /** * Distance Greater Than * - * @param string $attribute - * @param array $values - * @param int|float $distance - * @return string */ public static function distanceGreaterThan(string $attribute, array $values, int|float $distance, bool $meters = true): string { - return (new Query('distanceGreaterThan', $attribute, [[$values, $distance, $meters]]))->__toString(); + return new Query('distanceGreaterThan', $attribute, [[$values, $distance, $meters]])->__toString(); } /** * Distance Less Than * - * @param string $attribute - * @param array $values - * @param int|float $distance - * @param bool $meters - * @return string */ public static function distanceLessThan(string $attribute, array $values, int|float $distance, bool $meters = true): string { - return (new Query('distanceLessThan', $attribute, [[$values, $distance, $meters]]))->__toString(); + return new Query('distanceLessThan', $attribute, [[$values, $distance, $meters]])->__toString(); } /** * Vector Dot * - * @param string $attribute - * @param array $vector - * @return string */ public static function vectorDot(string $attribute, array $vector): string { - return (new Query('vectorDot', $attribute, [$vector]))->__toString(); + return new Query('vectorDot', $attribute, [$vector])->__toString(); } /** * Vector Cosine * - * @param string $attribute - * @param array $vector - * @return string */ public static function vectorCosine(string $attribute, array $vector): string { - return (new Query('vectorCosine', $attribute, [$vector]))->__toString(); + return new Query('vectorCosine', $attribute, [$vector])->__toString(); } /** * Vector Euclidean * - * @param string $attribute - * @param array $vector - * @return string */ public static function vectorEuclidean(string $attribute, array $vector): string { - return (new Query('vectorEuclidean', $attribute, [$vector]))->__toString(); + return new Query('vectorEuclidean', $attribute, [$vector])->__toString(); } /** * Intersects * - * @param string $attribute - * @param array $values - * @return string */ public static function intersects(string $attribute, array $values): string { - return (new Query('intersects', $attribute, [$values]))->__toString(); + return new Query('intersects', $attribute, [$values])->__toString(); } /** * Not Intersects * - * @param string $attribute - * @param array $values - * @return string */ public static function notIntersects(string $attribute, array $values): string { - return (new Query('notIntersects', $attribute, [$values]))->__toString(); + return new Query('notIntersects', $attribute, [$values])->__toString(); } /** * Crosses * - * @param string $attribute - * @param array $values - * @return string */ public static function crosses(string $attribute, array $values): string { - return (new Query('crosses', $attribute, [$values]))->__toString(); + return new Query('crosses', $attribute, [$values])->__toString(); } /** * Not Crosses * - * @param string $attribute - * @param array $values - * @return string */ public static function notCrosses(string $attribute, array $values): string { - return (new Query('notCrosses', $attribute, [$values]))->__toString(); + return new Query('notCrosses', $attribute, [$values])->__toString(); } /** * Overlaps * - * @param string $attribute - * @param array $values - * @return string */ public static function overlaps(string $attribute, array $values): string { - return (new Query('overlaps', $attribute, [$values]))->__toString(); + return new Query('overlaps', $attribute, [$values])->__toString(); } /** * Not Overlaps * - * @param string $attribute - * @param array $values - * @return string */ public static function notOverlaps(string $attribute, array $values): string { - return (new Query('notOverlaps', $attribute, [$values]))->__toString(); + return new Query('notOverlaps', $attribute, [$values])->__toString(); } /** * Touches * - * @param string $attribute - * @param array $values - * @return string */ public static function touches(string $attribute, array $values): string { - return (new Query('touches', $attribute, [$values]))->__toString(); + return new Query('touches', $attribute, [$values])->__toString(); } /** * Not Touches * - * @param string $attribute - * @param array $values - * @return string */ public static function notTouches(string $attribute, array $values): string { - return (new Query('notTouches', $attribute, [$values]))->__toString(); + return new Query('notTouches', $attribute, [$values])->__toString(); } } diff --git a/src/Appwrite/Role.php b/src/Appwrite/Role.php index 2cc3ffb2..1b772274 100644 --- a/src/Appwrite/Role.php +++ b/src/Appwrite/Role.php @@ -1,5 +1,7 @@ client = $client; } } diff --git a/src/Appwrite/Services/Account.php b/src/Appwrite/Services/Account.php index fb80d415..631f0fb9 100644 --- a/src/Appwrite/Services/Account.php +++ b/src/Appwrite/Services/Account.php @@ -1,27 +1,22 @@ client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -230,11 +206,7 @@ public function deleteConsent(string $consentId): string * represents one authorized device or session; the token secrets themselves * are never returned. * - * @param string $consentId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\Oauth2ConsentTokenList */ public function listConsentTokens(string $consentId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\Oauth2ConsentTokenList { @@ -271,17 +243,13 @@ public function listConsentTokens(string $consentId, ?array $queries = null, ?bo } return \Appwrite\Models\Oauth2ConsentTokenList::from($response); - } /** * Get a token family issued under an OAuth2 consent by its unique ID. The * token secrets themselves are never returned. * - * @param string $consentId - * @param string $tokenId * @throws AppwriteException - * @return \Appwrite\Models\Oauth2ConsentToken */ public function getConsentToken(string $consentId, string $tokenId): \Appwrite\Models\Oauth2ConsentToken { @@ -311,7 +279,6 @@ public function getConsentToken(string $consentId, string $tokenId): \Appwrite\M } return \Appwrite\Models\Oauth2ConsentToken::from($response); - } /** @@ -319,10 +286,7 @@ public function getConsentToken(string $consentId, string $tokenId): \Appwrite\M * access and refresh tokens of the family stop working immediately; other * token families and the consent itself are unaffected. * - * @param string $consentId - * @param string $tokenId * @throws AppwriteException - * @return string */ public function deleteConsentToken(string $consentId, string $tokenId): string { @@ -341,15 +305,12 @@ public function deleteConsentToken(string $consentId, string $tokenId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -360,12 +321,8 @@ public function deleteConsentToken(string $consentId, string $tokenId): string * user password is required to complete this request. * This endpoint can also be used to convert an anonymous account to a normal * one, by passing an email address and a new password. - * * - * @param string $email - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateEmail(string $email, string $password): \Appwrite\Models\User { @@ -396,16 +353,12 @@ public function updateEmail(string $email, string $password): \Appwrite\Models\U } return \Appwrite\Models\User::from($response); - } /** * Get the list of identities for the currently logged in user. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\IdentityList */ public function listIdentities(?array $queries = null, ?bool $total = null): \Appwrite\Models\IdentityList { @@ -441,15 +394,12 @@ public function listIdentities(?array $queries = null, ?bool $total = null): \Ap } return \Appwrite\Models\IdentityList::from($response); - } /** * Delete an identity by its unique ID. * - * @param string $identityId * @throws AppwriteException - * @return string */ public function deleteIdentity(string $identityId): string { @@ -466,25 +416,19 @@ public function deleteIdentity(string $identityId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get the list of latest security activity logs for the currently logged in * user. Each log returns user IP address, location and date and time of log. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\LogList */ public function listLogs(?array $queries = null, ?bool $total = null): \Appwrite\Models\LogList { @@ -520,15 +464,12 @@ public function listLogs(?array $queries = null, ?bool $total = null): \Appwrite } return \Appwrite\Models\LogList::from($response); - } /** * Enable or disable MFA on an account. * - * @param bool $mfa * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateMFA(bool $mfa): \Appwrite\Models\User { @@ -558,7 +499,6 @@ public function updateMFA(bool $mfa): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -567,15 +507,13 @@ public function updateMFA(bool $mfa): \Appwrite\Models\User * authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) * method. * - * @param AuthenticatorType $type * @throws AppwriteException - * @return \Appwrite\Models\MfaType */ public function createMFAAuthenticator(AuthenticatorType $type): \Appwrite\Models\MfaType { $apiPath = str_replace( ['{type}'], - [$type], + [(string) $type], '/account/mfa/authenticators/{type}' ); @@ -599,7 +537,6 @@ public function createMFAAuthenticator(AuthenticatorType $type): \Appwrite\Model } return \Appwrite\Models\MfaType::from($response); - } /** @@ -607,16 +544,13 @@ public function createMFAAuthenticator(AuthenticatorType $type): \Appwrite\Model * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) * method. * - * @param AuthenticatorType $type - * @param string $otp * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateMFAAuthenticator(AuthenticatorType $type, string $otp): \Appwrite\Models\User { $apiPath = str_replace( ['{type}'], - [$type], + [(string) $type], '/account/mfa/authenticators/{type}' ); @@ -641,21 +575,18 @@ public function updateMFAAuthenticator(AuthenticatorType $type, string $otp): \A } return \Appwrite\Models\User::from($response); - } /** * Delete an authenticator for a user by ID. * - * @param AuthenticatorType $type * @throws AppwriteException - * @return string */ public function deleteMFAAuthenticator(AuthenticatorType $type): string { $apiPath = str_replace( ['{type}'], - [$type], + [(string) $type], '/account/mfa/authenticators/{type}' ); @@ -666,15 +597,12 @@ public function deleteMFAAuthenticator(AuthenticatorType $type): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -682,9 +610,7 @@ public function deleteMFAAuthenticator(AuthenticatorType $type): string * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) * method. * - * @param AuthenticationFactor $factor * @throws AppwriteException - * @return \Appwrite\Models\MfaChallenge */ public function createMFAChallenge(AuthenticationFactor $factor): \Appwrite\Models\MfaChallenge { @@ -714,7 +640,6 @@ public function createMFAChallenge(AuthenticationFactor $factor): \Appwrite\Mode } return \Appwrite\Models\MfaChallenge::from($response); - } /** @@ -724,10 +649,7 @@ public function createMFAChallenge(AuthenticationFactor $factor): \Appwrite\Mode * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) * method. * - * @param string $challengeId - * @param string $otp * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function updateMFAChallenge(string $challengeId, string $otp): \Appwrite\Models\Session { @@ -758,14 +680,12 @@ public function updateMFAChallenge(string $challengeId, string $otp): \Appwrite\ } return \Appwrite\Models\Session::from($response); - } /** * List the factors available on the account to be used as a MFA challange. * * @throws AppwriteException - * @return \Appwrite\Models\MfaFactors */ public function listMFAFactors(): \Appwrite\Models\MfaFactors { @@ -793,7 +713,6 @@ public function listMFAFactors(): \Appwrite\Models\MfaFactors } return \Appwrite\Models\MfaFactors::from($response); - } /** @@ -803,7 +722,6 @@ public function listMFAFactors(): \Appwrite\Models\MfaFactors * method. An OTP challenge is required to read recovery codes. * * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function getMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes { @@ -831,7 +749,6 @@ public function getMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** @@ -842,7 +759,6 @@ public function getMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes * method. * * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function createMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes { @@ -871,7 +787,6 @@ public function createMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** @@ -881,7 +796,6 @@ public function createMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes * method. An OTP challenge is required to regenreate recovery codes. * * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function updateMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes { @@ -910,15 +824,12 @@ public function updateMFARecoveryCodes(): \Appwrite\Models\MfaRecoveryCodes } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** * Update currently logged in user account name. * - * @param string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateName(string $name): \Appwrite\Models\User { @@ -948,7 +859,6 @@ public function updateName(string $name): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -956,10 +866,7 @@ public function updateName(string $name): \Appwrite\Models\User * to pass in the new password, and the old password. For users created with * OAuth, Team Invites and Magic URL, oldPassword is optional. * - * @param string $password - * @param ?string $oldPassword * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePassword(string $password, ?string $oldPassword = null): \Appwrite\Models\User { @@ -993,7 +900,6 @@ public function updatePassword(string $password, ?string $oldPassword = null): \ } return \Appwrite\Models\User::from($response); - } /** @@ -1003,10 +909,7 @@ public function updatePassword(string $password, ?string $oldPassword = null): \ * /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) * endpoint to send a confirmation SMS. * - * @param string $phone - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePhone(string $phone, string $password): \Appwrite\Models\User { @@ -1037,14 +940,12 @@ public function updatePhone(string $phone, string $password): \Appwrite\Models\U } return \Appwrite\Models\User::from($response); - } /** * Get the preferences as a key-value object for the currently logged in user. * * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function getPrefs(): \Appwrite\Models\Preferences { @@ -1072,7 +973,6 @@ public function getPrefs(): \Appwrite\Models\Preferences } return \Appwrite\Models\Preferences::from($response); - } /** @@ -1080,9 +980,7 @@ public function getPrefs(): \Appwrite\Models\Preferences * stored as is, and replaces any previous value. The maximum allowed prefs * size is 64kB and throws error if exceeded. * - * @param array $prefs * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePrefs(array $prefs): \Appwrite\Models\User { @@ -1112,7 +1010,6 @@ public function updatePrefs(array $prefs): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -1125,10 +1022,7 @@ public function updatePrefs(array $prefs): \Appwrite\Models\User * endpoint to complete the process. The verification link sent to the user's * email address is valid for 1 hour. * - * @param string $email - * @param string $url * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createRecovery(string $email, string $url): \Appwrite\Models\Token { @@ -1159,7 +1053,6 @@ public function createRecovery(string $email, string $url): \Appwrite\Models\Tok } return \Appwrite\Models\Token::from($response); - } /** @@ -1168,17 +1061,13 @@ public function createRecovery(string $email, string $url): \Appwrite\Models\Tok * the redirect URL you have provided when sending your request to the [POST * /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) * endpoint. - * + * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. * - * @param string $userId - * @param string $secret - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function updateRecovery(string $userId, string $secret, string $password): \Appwrite\Models\Token { @@ -1210,7 +1099,6 @@ public function updateRecovery(string $userId, string $secret, string $password) } return \Appwrite\Models\Token::from($response); - } /** @@ -1218,7 +1106,6 @@ public function updateRecovery(string $userId, string $secret, string $password) * logged in user. * * @throws AppwriteException - * @return \Appwrite\Models\SessionList */ public function listSessions(): \Appwrite\Models\SessionList { @@ -1246,7 +1133,6 @@ public function listSessions(): \Appwrite\Models\SessionList } return \Appwrite\Models\SessionList::from($response); - } /** @@ -1254,7 +1140,6 @@ public function listSessions(): \Appwrite\Models\SessionList * from the end client. * * @throws AppwriteException - * @return string */ public function deleteSessions(): string { @@ -1270,15 +1155,12 @@ public function deleteSessions(): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1291,7 +1173,6 @@ public function deleteSessions(): string * session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session). * * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function createAnonymousSession(): \Appwrite\Models\Session { @@ -1320,21 +1201,17 @@ public function createAnonymousSession(): \Appwrite\Models\Session } return \Appwrite\Models\Session::from($response); - } /** * Allow the user to login into their account by providing a valid email and * password combination. This route will create a new session for the user. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). * - * @param string $email - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function createEmailPasswordSession(string $email, string $password): \Appwrite\Models\Session { @@ -1365,7 +1242,6 @@ public function createEmailPasswordSession(string $email, string $password): \Ap } return \Appwrite\Models\Session::from($response); - } /** @@ -1373,10 +1249,7 @@ public function createEmailPasswordSession(string $email, string $password): \Ap * and **secret** parameters from the successful response of authentication * flows initiated by token creation. For example, magic URL and phone login. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Session * * @deprecated This API has been deprecated since 1.6.0. Please use `createSession` instead. * @see Account::createSession @@ -1410,7 +1283,6 @@ public function updateMagicURLSession(string $userId, string $secret): \Appwrite } return \Appwrite\Models\Session::from($response); - } /** @@ -1418,10 +1290,7 @@ public function updateMagicURLSession(string $userId, string $secret): \Appwrite * and **secret** parameters from the successful response of authentication * flows initiated by token creation. For example, magic URL and phone login. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Session * * @deprecated This API has been deprecated since 1.6.0. Please use `createSession` instead. * @see Account::createSession @@ -1455,7 +1324,6 @@ public function updatePhoneSession(string $userId, string $secret): \Appwrite\Mo } return \Appwrite\Models\Session::from($response); - } /** @@ -1463,10 +1331,7 @@ public function updatePhoneSession(string $userId, string $secret): \Appwrite\Mo * and **secret** parameters from the successful response of authentication * flows initiated by token creation. For example, magic URL and phone login. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function createSession(string $userId, string $secret): \Appwrite\Models\Session { @@ -1497,16 +1362,13 @@ public function createSession(string $userId, string $secret): \Appwrite\Models\ } return \Appwrite\Models\Session::from($response); - } /** * Use this endpoint to get a logged in user's session using a Session ID. * Inputting 'current' will return the current session being used. * - * @param string $sessionId * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function getSession(string $sessionId): \Appwrite\Models\Session { @@ -1535,7 +1397,6 @@ public function getSession(string $sessionId): \Appwrite\Models\Session } return \Appwrite\Models\Session::from($response); - } /** @@ -1543,9 +1404,7 @@ public function getSession(string $sessionId): \Appwrite\Models\Session * useful when session expiry is short. If the session was created using an * OAuth provider, this endpoint refreshes the access token from the provider. * - * @param string $sessionId * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function updateSession(string $sessionId): \Appwrite\Models\Session { @@ -1575,7 +1434,6 @@ public function updateSession(string $sessionId): \Appwrite\Models\Session } return \Appwrite\Models\Session::from($response); - } /** @@ -1585,9 +1443,7 @@ public function updateSession(string $sessionId): \Appwrite\Models\Session * Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) * instead. * - * @param string $sessionId * @throws AppwriteException - * @return string */ public function deleteSession(string $sessionId): string { @@ -1604,15 +1460,12 @@ public function deleteSession(string $sessionId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1621,7 +1474,6 @@ public function deleteSession(string $sessionId): string * completely delete a user, use the Users API instead. * * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateStatus(): \Appwrite\Models\User { @@ -1650,7 +1502,6 @@ public function updateStatus(): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -1663,17 +1514,12 @@ public function updateStatus(): \Appwrite\Models\User * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint to complete the login process. The secret sent to the user's email * is valid for 15 minutes. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). - * * - * @param string $userId - * @param string $email - * @param ?bool $phrase * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createEmailToken(string $userId, string $email, ?bool $phrase = null): \Appwrite\Models\Token { @@ -1708,7 +1554,6 @@ public function createEmailToken(string $userId, string $email, ?bool $phrase = } return \Appwrite\Models\Token::from($response); - } /** @@ -1721,18 +1566,12 @@ public function createEmailToken(string $userId, string $email, ?bool $phrase = * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint to complete the login process. The link sent to the user's email * address is valid for 1 hour. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). - * * - * @param string $userId - * @param string $email - * @param ?string $url - * @param ?bool $phrase * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createMagicURLToken(string $userId, string $email, ?string $url = null, ?bool $phrase = null): \Appwrite\Models\Token { @@ -1771,37 +1610,31 @@ public function createMagicURLToken(string $userId, string $email, ?string $url } return \Appwrite\Models\Token::from($response); - } /** * Allow the user to login to their account using the OAuth2 provider of their * choice. Each OAuth2 provider should be enabled from the Appwrite console * first. Use the success and failure arguments to provide a redirect URL's - * back to your app when login is completed. - * + * back to your app when login is completed. + * * If authentication succeeds, `userId` and `secret` of a token will be * appended to the success URL as query parameters. These can be used to * create a new session using the [Create * session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). * - * @param OAuthProvider $provider - * @param ?string $success - * @param ?string $failure - * @param ?array $scopes * @throws AppwriteException - * @return string */ public function createOAuth2Token(OAuthProvider $provider, ?string $success = null, ?string $failure = null, ?array $scopes = null): string { $apiPath = str_replace( ['{provider}'], - [$provider], + [(string) $provider], '/account/tokens/oauth2/{provider}' ); @@ -1824,15 +1657,13 @@ public function createOAuth2Token(OAuthProvider $provider, ?string $success = nu $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'text/html'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, - $apiParams, 'location' + $apiParams, + 'location' ); - - return $response; - } /** @@ -1842,15 +1673,12 @@ public function createOAuth2Token(OAuthProvider $provider, ?string $success = nu * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint to complete the login process. The secret sent to the user's phone * is valid for 15 minutes. - * + * * A user is limited to 10 active sessions at a time by default. [Learn more * about session * limits](https://appwrite.io/docs/authentication-security#limits). * - * @param string $userId - * @param string $phone * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createPhoneToken(string $userId, string $phone): \Appwrite\Models\Token { @@ -1881,7 +1709,6 @@ public function createPhoneToken(string $userId, string $phone): \Appwrite\Model } return \Appwrite\Models\Token::from($response); - } /** @@ -1894,16 +1721,13 @@ public function createPhoneToken(string $userId, string $phone): \Appwrite\Model * parameters. Learn more about how to [complete the verification * process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). * The verification link sent to the user's email address is valid for 7 days. - * + * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. - * * - * @param string $url * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createEmailVerification(string $url): \Appwrite\Models\Token { @@ -1933,7 +1757,6 @@ public function createEmailVerification(string $url): \Appwrite\Models\Token } return \Appwrite\Models\Token::from($response); - } /** @@ -1946,16 +1769,13 @@ public function createEmailVerification(string $url): \Appwrite\Models\Token * parameters. Learn more about how to [complete the verification * process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). * The verification link sent to the user's email address is valid for 7 days. - * + * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. - * * - * @param string $url * @throws AppwriteException - * @return \Appwrite\Models\Token * * @deprecated This API has been deprecated since 1.8.0. Please use `createEmailVerification` instead. * @see Account::createEmailVerification @@ -1988,7 +1808,6 @@ public function createVerification(string $url): \Appwrite\Models\Token } return \Appwrite\Models\Token::from($response); - } /** @@ -1997,10 +1816,7 @@ public function createVerification(string $url): \Appwrite\Models\Token * to verify the user email ownership. If confirmed this route will return a * 200 status code. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function updateEmailVerification(string $userId, string $secret): \Appwrite\Models\Token { @@ -2031,7 +1847,6 @@ public function updateEmailVerification(string $userId, string $secret): \Appwri } return \Appwrite\Models\Token::from($response); - } /** @@ -2040,10 +1855,7 @@ public function updateEmailVerification(string $userId, string $secret): \Appwri * to verify the user email ownership. If confirmed this route will return a * 200 status code. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Token * * @deprecated This API has been deprecated since 1.8.0. Please use `updateEmailVerification` instead. * @see Account::updateEmailVerification @@ -2077,7 +1889,6 @@ public function updateVerification(string $userId, string $secret): \Appwrite\Mo } return \Appwrite\Models\Token::from($response); - } /** @@ -2091,7 +1902,6 @@ public function updateVerification(string $userId, string $secret): \Appwrite\Mo * minutes. * * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createPhoneVerification(): \Appwrite\Models\Token { @@ -2120,7 +1930,6 @@ public function createPhoneVerification(): \Appwrite\Models\Token } return \Appwrite\Models\Token::from($response); - } /** @@ -2129,10 +1938,7 @@ public function createPhoneVerification(): \Appwrite\Models\Token * verify the user email ownership. If confirmed this route will return a 200 * status code. * - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function updatePhoneVerification(string $userId, string $secret): \Appwrite\Models\Token { @@ -2163,6 +1969,5 @@ public function updatePhoneVerification(string $userId, string $secret): \Appwri } return \Appwrite\Models\Token::from($response); - } } diff --git a/src/Appwrite/Services/Activities.php b/src/Appwrite/Services/Activities.php index 925c4c23..4cb0ebb3 100644 --- a/src/Appwrite/Services/Activities.php +++ b/src/Appwrite/Services/Activities.php @@ -1,25 +1,19 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List the insights produced under a single analyzer report. You can use the * query params to filter your results further. - * * - * @param string $reportId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\InsightList */ public function listInsights(string $reportId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\InsightList { @@ -181,17 +157,12 @@ public function listInsights(string $reportId, ?array $queries = null, ?bool $to } return \Appwrite\Models\InsightList::from($response); - } /** * Get an insight by its unique ID, scoped to its parent report. - * * - * @param string $reportId - * @param string $insightId * @throws AppwriteException - * @return \Appwrite\Models\Insight */ public function getInsight(string $reportId, string $insightId): \Appwrite\Models\Insight { @@ -221,6 +192,5 @@ public function getInsight(string $reportId, string $insightId): \Appwrite\Model } return \Appwrite\Models\Insight::from($response); - } } diff --git a/src/Appwrite/Services/Apps.php b/src/Appwrite/Services/Apps.php index 69b47975..c66741f0 100644 --- a/src/Appwrite/Services/Apps.php +++ b/src/Appwrite/Services/Apps.php @@ -1,26 +1,19 @@ client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -457,11 +394,7 @@ public function delete(string $appId): string * `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller * with update access to the app. * - * @param string $appId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppInstallationList */ public function listInstallations(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList { @@ -498,7 +431,6 @@ public function listInstallations(string $appId, ?array $queries = null, ?bool $ } return \Appwrite\Models\AppInstallationList::from($response); - } /** @@ -506,10 +438,7 @@ public function listInstallations(string $appId, ?array $queries = null, ?bool $ * sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, * or a caller with update access to the app. * - * @param string $appId - * @param string $installationId * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function getInstallation(string $appId, string $installationId): \Appwrite\Models\AppInstallation { @@ -539,7 +468,6 @@ public function getInstallation(string $appId, string $installationId): \Appwrit } return \Appwrite\Models\AppInstallation::from($response); - } /** @@ -547,10 +475,7 @@ public function getInstallation(string $appId, string $installationId): \Appwrit * caller with update access to the app. Previously issued installation access * tokens are revoked. * - * @param string $appId - * @param string $installationId * @throws AppwriteException - * @return string */ public function deleteInstallation(string $appId, string $installationId): string { @@ -569,15 +494,12 @@ public function deleteInstallation(string $appId, string $installationId): strin $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -590,10 +512,7 @@ public function deleteInstallation(string $appId, string $installationId): strin * once; each token stays valid until it expires or the installation is * updated or deleted. * - * @param string $appId - * @param string $installationId * @throws AppwriteException - * @return \Appwrite\Models\Oauth2Token */ public function createInstallationToken(string $appId, string $installationId): \Appwrite\Models\Oauth2Token { @@ -624,17 +543,12 @@ public function createInstallationToken(string $appId, string $installationId): } return \Appwrite\Models\Oauth2Token::from($response); - } /** * List app keys for an application. * - * @param string $appId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppKeyList */ public function listKeys(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppKeyList { @@ -671,7 +585,6 @@ public function listKeys(string $appId, ?array $queries = null, ?bool $total = n } return \Appwrite\Models\AppKeyList::from($response); - } /** @@ -679,9 +592,7 @@ public function listKeys(string $appId, ?array $queries = null, ?bool $total = n * in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header to * list the application's installations and create installation access tokens. * - * @param string $appId * @throws AppwriteException - * @return \Appwrite\Models\AppKey */ public function createKey(string $appId): \Appwrite\Models\AppKey { @@ -711,16 +622,12 @@ public function createKey(string $appId): \Appwrite\Models\AppKey } return \Appwrite\Models\AppKey::from($response); - } /** * Get an app key by its unique ID. * - * @param string $appId - * @param string $keyId * @throws AppwriteException - * @return \Appwrite\Models\AppKey */ public function getKey(string $appId, string $keyId): \Appwrite\Models\AppKey { @@ -750,16 +657,12 @@ public function getKey(string $appId, string $keyId): \Appwrite\Models\AppKey } return \Appwrite\Models\AppKey::from($response); - } /** * Delete an app key by its unique ID. * - * @param string $appId - * @param string $keyId * @throws AppwriteException - * @return string */ public function deleteKey(string $appId, string $keyId): string { @@ -778,15 +681,12 @@ public function deleteKey(string $appId, string $keyId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -794,10 +694,7 @@ public function deleteKey(string $appId, string $keyId): string * a server SDK using a project API key can set them. Replaces the previous * labels. * - * @param string $appId - * @param array $labels * @throws AppwriteException - * @return \Appwrite\Models\App */ public function updateLabels(string $appId, array $labels): \Appwrite\Models\App { @@ -828,17 +725,12 @@ public function updateLabels(string $appId, array $labels): \Appwrite\Models\App } return \Appwrite\Models\App::from($response); - } /** * List client secrets for an application. * - * @param string $appId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppSecretList */ public function listSecrets(string $appId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppSecretList { @@ -875,15 +767,12 @@ public function listSecrets(string $appId, ?array $queries = null, ?bool $total } return \Appwrite\Models\AppSecretList::from($response); - } /** * Create a new client secret for an application. * - * @param string $appId * @throws AppwriteException - * @return \Appwrite\Models\AppSecretPlaintext */ public function createSecret(string $appId): \Appwrite\Models\AppSecretPlaintext { @@ -913,16 +802,12 @@ public function createSecret(string $appId): \Appwrite\Models\AppSecretPlaintext } return \Appwrite\Models\AppSecretPlaintext::from($response); - } /** * Get an application client secret by its unique ID. * - * @param string $appId - * @param string $secretId * @throws AppwriteException - * @return \Appwrite\Models\AppSecret */ public function getSecret(string $appId, string $secretId): \Appwrite\Models\AppSecret { @@ -952,16 +837,12 @@ public function getSecret(string $appId, string $secretId): \Appwrite\Models\App } return \Appwrite\Models\AppSecret::from($response); - } /** * Delete an application client secret by its unique ID. * - * @param string $appId - * @param string $secretId * @throws AppwriteException - * @return string */ public function deleteSecret(string $appId, string $secretId): string { @@ -980,24 +861,18 @@ public function deleteSecret(string $appId, string $secretId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Transfer an application to another team by its unique ID. * - * @param string $appId - * @param string $teamId * @throws AppwriteException - * @return \Appwrite\Models\App */ public function updateTeam(string $appId, string $teamId): \Appwrite\Models\App { @@ -1028,15 +903,12 @@ public function updateTeam(string $appId, string $teamId): \Appwrite\Models\App } return \Appwrite\Models\App::from($response); - } /** * Revoke all tokens for an application by its unique ID. * - * @param string $appId * @throws AppwriteException - * @return string */ public function deleteTokens(string $appId): string { @@ -1054,14 +926,11 @@ public function deleteTokens(string $appId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Avatars.php b/src/Appwrite/Services/Avatars.php index 3417a6d0..39ef900a 100644 --- a/src/Appwrite/Services/Avatars.php +++ b/src/Appwrite/Services/Avatars.php @@ -1,50 +1,40 @@ client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * The credit card endpoint will return you the icon of the credit card * provider you need. Use width, height and quality arguments to change the * output settings. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * * - * @param CreditCard $code - * @param ?int $width - * @param ?int $height - * @param ?int $quality * @throws AppwriteException - * @return string */ public function getCreditCard(CreditCard $code, ?int $width = null, ?int $height = null, ?int $quality = null): string { $apiPath = str_replace( ['{code}'], - [$code], + [(string) $code], '/avatars/credit-cards/{code}' ); @@ -123,26 +104,21 @@ public function getCreditCard(CreditCard $code, ?int $width = null, ?int $height $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote * website URL. - * + * * This endpoint does not follow HTTP redirects. * - * @param string $url * @throws AppwriteException - * @return string */ public function getFavicon(string $url): string { @@ -159,15 +135,12 @@ public function getFavicon(string $url): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -175,25 +148,19 @@ public function getFavicon(string $url): string * users. The code argument receives the 2 letter country code. Use width, * height and quality arguments to change the output settings. Country codes * follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * * - * @param Flag $code - * @param ?int $width - * @param ?int $height - * @param ?int $quality * @throws AppwriteException - * @return string */ public function getFlag(Flag $code, ?int $width = null, ?int $height = null, ?int $quality = null): string { $apiPath = str_replace( ['{code}'], - [$code], + [(string) $code], '/avatars/flags/{code}' ); @@ -216,15 +183,12 @@ public function getFlag(Flag $code, ?int $width = null, ?int $height = null, ?in $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -232,19 +196,15 @@ public function getFlag(Flag $code, ?int $width = null, ?int $height = null, ?in * you want. This endpoint is very useful if you need to crop and display * remote images in your app or in case you want to make sure a 3rd party * image is properly served using a TLS protocol. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 400x400px. - * + * * This endpoint does not follow HTTP redirects. * - * @param string $url - * @param ?int $width - * @param ?int $height * @throws AppwriteException - * @return string */ public function getImage(string $url, ?int $width = null, ?int $height = null): string { @@ -269,15 +229,12 @@ public function getImage(string $url, ?int $width = null, ?int $height = null): $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -286,24 +243,18 @@ public function getImage(string $url, ?int $width = null, ?int $height = null): * email initials. You can also overwrite the user name if you pass the 'name' * parameter. If no name is given and no user is logged, an empty avatar will * be returned. - * + * * You can use the color and background params to change the avatar colors. By * default, a random theme will be selected. The random theme will persist for * the user's initials when reloading the same theme will always return for * the same initials. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * * - * @param ?string $name - * @param ?int $width - * @param ?int $height - * @param ?string $background * @throws AppwriteException - * @return string */ public function getInitials(?string $name = null, ?int $width = null, ?int $height = null, ?string $background = null): string { @@ -335,28 +286,89 @@ public function getInitials(?string $name = null, ?int $width = null, ?int $heig $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); + } + + /** + * Returns the best available profile photo for a user. The endpoint tries + * each source in priority order and returns the first successful result: + * OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in + * static fallback. + * + * The photo resolves for the currently authenticated user unless `userId` + * points at another user. Passing `emailHash` and/or `name` resolves the + * avatar from those values alone: the hash is looked up on Gravatar and + * Libravatar, the name is rendered as initials, and the user's own identity + * photos, email, and name leave the chain so they never shadow the avatar + * being asked for. Emails are only ever accepted pre-hashed, so no address + * ends up in a URL. + * + * @throws AppwriteException + */ + public function getPhoto(?int $width = null, ?int $height = null, ?int $quality = null, ?string $output = null, ?string $rating = null, ?string $userId = null, ?string $emailHash = null, ?string $name = null): string + { + $apiPath = str_replace( + [], + [], + '/avatars/photo' + ); + + $apiParams = []; + + if (!is_null($width)) { + $apiParams['width'] = $width; + } + + if (!is_null($height)) { + $apiParams['height'] = $height; + } + + if (!is_null($quality)) { + $apiParams['quality'] = $quality; + } + + if (!is_null($output)) { + $apiParams['output'] = $output; + } + + if (!is_null($rating)) { + $apiParams['rating'] = $rating; + } + + if (!is_null($userId)) { + $apiParams['userId'] = $userId; + } + + if (!is_null($emailHash)) { + $apiParams['emailHash'] = $emailHash; + } + + if (!is_null($name)) { + $apiParams['name'] = $name; + } - return $response; + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['accept'] = 'image/*'; + return $this->client->call( + Client::METHOD_GET, + $apiPath, + $apiHeaders, + $apiParams + ); } /** * Converts a given plain text to a QR code image. You can use the query * parameters to change the size and style of the resulting image. - * * - * @param string $text - * @param ?int $size - * @param ?int $margin - * @param ?bool $download * @throws AppwriteException - * @return string */ public function getQR(string $text, ?int $size = null, ?int $margin = null, ?bool $download = null): string { @@ -385,51 +397,27 @@ public function getQR(string $text, ?int $size = null, ?int $margin = null, ?boo $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Use this endpoint to capture a screenshot of any website URL. This endpoint * uses a headless browser to render the webpage and capture it as an image. - * + * * You can configure the browser viewport size, theme, user agent, * geolocation, permissions, and more. Capture either just the viewport or the * full page scroll. - * + * * When width and height are specified, the image is resized accordingly. If * both dimensions are 0, the API provides an image at original size. If * dimensions are not specified, the default viewport size is 1280x720px. * - * @param string $url - * @param ?array $headers - * @param ?int $viewportWidth - * @param ?int $viewportHeight - * @param ?float $scale - * @param ?BrowserTheme $theme - * @param ?string $userAgent - * @param ?bool $fullpage - * @param ?string $locale - * @param ?Timezone $timezone - * @param ?float $latitude - * @param ?float $longitude - * @param ?float $accuracy - * @param ?bool $touch - * @param ?array $permissions - * @param ?int $sleep - * @param ?int $width - * @param ?int $height - * @param ?int $quality - * @param ?ImageFormat $output * @throws AppwriteException - * @return string */ public function getScreenshot(string $url, ?array $headers = null, ?int $viewportWidth = null, ?int $viewportHeight = null, ?float $scale = null, ?BrowserTheme $theme = null, ?string $userAgent = null, ?bool $fullpage = null, ?string $locale = null, ?Timezone $timezone = null, ?float $latitude = null, ?float $longitude = null, ?float $accuracy = null, ?bool $touch = null, ?array $permissions = null, ?int $sleep = null, ?int $width = null, ?int $height = null, ?int $quality = null, ?ImageFormat $output = null): string { @@ -522,14 +510,11 @@ public function getScreenshot(string $url, ?array $headers = null, ?int $viewpor $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/png'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Backups.php b/src/Appwrite/Services/Backups.php index ce513ff4..b67014b4 100644 --- a/src/Appwrite/Services/Backups.php +++ b/src/Appwrite/Services/Backups.php @@ -1,26 +1,19 @@ client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List all policies for a project. * - * @param ?array $queries * @throws AppwriteException - * @return \Appwrite\Models\BackupPolicyList */ public function listPolicies(?array $queries = null): \Appwrite\Models\BackupPolicyList { @@ -203,21 +181,12 @@ public function listPolicies(?array $queries = null): \Appwrite\Models\BackupPol } return \Appwrite\Models\BackupPolicyList::from($response); - } /** * Create a new backup policy. * - * @param string $policyId - * @param array $services - * @param int $retention - * @param string $schedule - * @param ?string $name - * @param ?string $resourceId - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\BackupPolicy */ public function createPolicy(string $policyId, array $services, int $retention, string $schedule, ?string $name = null, ?string $resourceId = null, ?bool $enabled = null): \Appwrite\Models\BackupPolicy { @@ -259,15 +228,12 @@ public function createPolicy(string $policyId, array $services, int $retention, } return \Appwrite\Models\BackupPolicy::from($response); - } /** * Get a backup policy using it's ID. * - * @param string $policyId * @throws AppwriteException - * @return \Appwrite\Models\BackupPolicy */ public function getPolicy(string $policyId): \Appwrite\Models\BackupPolicy { @@ -296,19 +262,12 @@ public function getPolicy(string $policyId): \Appwrite\Models\BackupPolicy } return \Appwrite\Models\BackupPolicy::from($response); - } /** * Update an existing policy using it's ID. * - * @param string $policyId - * @param ?string $name - * @param ?int $retention - * @param ?string $schedule - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\BackupPolicy */ public function updatePolicy(string $policyId, ?string $name = null, ?int $retention = null, ?string $schedule = null, ?bool $enabled = null): \Appwrite\Models\BackupPolicy { @@ -345,15 +304,12 @@ public function updatePolicy(string $policyId, ?string $name = null, ?int $reten } return \Appwrite\Models\BackupPolicy::from($response); - } /** * Delete a policy using it's ID. * - * @param string $policyId * @throws AppwriteException - * @return string */ public function deletePolicy(string $policyId): string { @@ -371,33 +327,30 @@ public function deletePolicy(string $policyId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Create and trigger a new restoration for a backup on a project. - * + * * For a backup of one database, the restoration resolves its destination * before it is queued. When `newResourceId` is omitted, the archived database * is restored in place and its own ID is returned in `options`. Pass a * different `newResourceId` to restore alongside it as a new database * instead. - * + * * The restoration migration records the archived database in `resourceId` and * `resourceType`, and the resolved database in `destinationResourceId` and * `destinationResourceType`. Database types are stored canonically as * `database`, `documentsdb`, or `vectorsdb`. Project-wide restorations leave * these fields empty because they do not have a single source or destination * database. - * + * * To list every migration related to one database, use its canonical type in * a nested `OR(AND(...), AND(...), AND(...))` across the root, parent, and * destination relation pairs: `(resourceType, resourceId)`, @@ -405,7 +358,7 @@ public function deletePolicy(string $policyId): string * destinationResourceId)`. Legacy and TablesDB databases use `database`; the * operational `resourceType` of a table migration is not rewritten to * `tablesdb`. - * + * * When restoring a DocumentsDB or VectorsDB database from a dedicated source, * the restore provisions a fresh dedicated backing database at the source * database's own specification and lands the data there. An in-place restore @@ -414,14 +367,8 @@ public function deletePolicy(string $policyId): string * the source keeps serving its own data until the restored data is in place * and any failure leaves it untouched. A serverless source has no dedicated * backing to clone and restores onto the archived database instead. - * * - * @param string $archiveId - * @param array $services - * @param ?string $newResourceId - * @param ?string $newResourceName * @throws AppwriteException - * @return \Appwrite\Models\BackupRestoration */ public function createRestoration(string $archiveId, array $services, ?string $newResourceId = null, ?string $newResourceName = null): \Appwrite\Models\BackupRestoration { @@ -460,15 +407,12 @@ public function createRestoration(string $archiveId, array $services, ?string $n } return \Appwrite\Models\BackupRestoration::from($response); - } /** * List all backup restorations for a project. * - * @param ?array $queries * @throws AppwriteException - * @return \Appwrite\Models\BackupRestorationList */ public function listRestorations(?array $queries = null): \Appwrite\Models\BackupRestorationList { @@ -500,15 +444,12 @@ public function listRestorations(?array $queries = null): \Appwrite\Models\Backu } return \Appwrite\Models\BackupRestorationList::from($response); - } /** * Get the current status of a backup restoration. * - * @param string $restorationId * @throws AppwriteException - * @return \Appwrite\Models\BackupRestoration */ public function getRestoration(string $restorationId): \Appwrite\Models\BackupRestoration { @@ -537,6 +478,5 @@ public function getRestoration(string $restorationId): \Appwrite\Models\BackupRe } return \Appwrite\Models\BackupRestoration::from($response); - } } diff --git a/src/Appwrite/Services/Databases.php b/src/Appwrite/Services/Databases.php index 8c7d3a33..3579519b 100644 --- a/src/Appwrite/Services/Databases.php +++ b/src/Appwrite/Services/Databases.php @@ -1,32 +1,23 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Create multiple operations in a single transaction. * - * @param string $transactionId - * @param ?array $operations * @throws AppwriteException - * @return \Appwrite\Models\Transaction * * @deprecated This API has been deprecated since 1.8.0. Please use `createOperations` instead. * @see TablesDB::createOperations @@ -378,16 +340,13 @@ public function createOperations(string $transactionId, ?array $operations = nul } return \Appwrite\Models\Transaction::from($response); - } /** * Get a database by its unique ID. This endpoint response returns a JSON * object with the database metadata. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\Database * * @deprecated This API has been deprecated since 1.8.0. Please use `get` instead. * @see TablesDB::get @@ -419,17 +378,12 @@ public function get(string $databaseId): \Appwrite\Models\Database } return \Appwrite\Models\Database::from($response); - } /** * Update a database by its unique ID. * - * @param string $databaseId - * @param ?string $name - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Database * * @deprecated This API has been deprecated since 1.8.0. Please use `update` instead. * @see TablesDB::update @@ -470,16 +424,13 @@ public function update(string $databaseId, ?string $name = null, ?bool $enabled } return \Appwrite\Models\Database::from($response); - } /** * Delete a database by its unique ID. Only API keys with with databases.write * scope can delete a database. * - * @param string $databaseId * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `delete` instead. * @see TablesDB::delete @@ -499,27 +450,19 @@ public function delete(string $databaseId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all collections that belong to the provided databaseId. You * can use the search parameter to filter your results. * - * @param string $databaseId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\CollectionList * * @deprecated This API has been deprecated since 1.8.0. Please use `listTables` instead. * @see TablesDB::listTables @@ -563,7 +506,6 @@ public function listCollections(string $databaseId, ?array $queries = null, ?str } return \Appwrite\Models\CollectionList::from($response); - } /** @@ -572,16 +514,7 @@ public function listCollections(string $databaseId, ?array $queries = null, ?str * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. * - * @param string $databaseId - * @param string $collectionId - * @param string $name - * @param ?array $permissions - * @param ?bool $documentSecurity - * @param ?bool $enabled - * @param ?array $attributes - * @param ?array $indexes * @throws AppwriteException - * @return \Appwrite\Models\Collection * * @deprecated This API has been deprecated since 1.8.0. Please use `createTable` instead. * @see TablesDB::createTable @@ -633,17 +566,13 @@ public function createCollection(string $databaseId, string $collectionId, strin } return \Appwrite\Models\Collection::from($response); - } /** * Get a collection by its unique ID. This endpoint response returns a JSON * object with the collection metadata. * - * @param string $databaseId - * @param string $collectionId * @throws AppwriteException - * @return \Appwrite\Models\Collection * * @deprecated This API has been deprecated since 1.8.0. Please use `getTable` instead. * @see TablesDB::getTable @@ -676,21 +605,12 @@ public function getCollection(string $databaseId, string $collectionId): \Appwri } return \Appwrite\Models\Collection::from($response); - } /** * Update a collection by its unique ID. * - * @param string $databaseId - * @param string $collectionId - * @param ?string $name - * @param ?array $permissions - * @param ?bool $documentSecurity - * @param ?bool $enabled - * @param ?bool $purge * @throws AppwriteException - * @return \Appwrite\Models\Collection * * @deprecated This API has been deprecated since 1.8.0. Please use `updateTable` instead. * @see TablesDB::updateTable @@ -741,17 +661,13 @@ public function updateCollection(string $databaseId, string $collectionId, ?stri } return \Appwrite\Models\Collection::from($response); - } /** * Delete a collection by its unique ID. Only users with write permissions * have access to delete this resource. * - * @param string $databaseId - * @param string $collectionId * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteTable` instead. * @see TablesDB::deleteTable @@ -772,26 +688,18 @@ public function deleteCollection(string $databaseId, string $collectionId): stri $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List attributes in the collection. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AttributeList * * @deprecated This API has been deprecated since 1.8.0. Please use `listColumns` instead. * @see TablesDB::listColumns @@ -832,24 +740,13 @@ public function listAttributes(string $databaseId, string $collectionId, ?array } return \Appwrite\Models\AttributeList::from($response); - } /** * Create a bigint attribute. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?int $min - * @param ?int $max - * @param ?int $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeBigint * * @deprecated This API has been deprecated since 1.8.0. Please use `createBigIntColumn` instead. * @see TablesDB::createBigIntColumn @@ -892,24 +789,13 @@ public function createBigIntAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeBigint::from($response); - } /** * Update a bigint attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?int $xdefault - * @param ?int $min - * @param ?int $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeBigint * * @deprecated This API has been deprecated since 1.8.0. Please use `updateBigIntColumn` instead. * @see TablesDB::updateBigIntColumn @@ -949,21 +835,12 @@ public function updateBigIntAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeBigint::from($response); - } /** * Create a boolean attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?bool $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeBoolean * * @deprecated This API has been deprecated since 1.8.0. Please use `createBooleanColumn` instead. * @see TablesDB::createBooleanColumn @@ -1004,21 +881,13 @@ public function createBooleanAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeBoolean::from($response); - } /** * Update a boolean attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?bool $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeBoolean * * @deprecated This API has been deprecated since 1.8.0. Please use `updateBooleanColumn` instead. * @see TablesDB::updateBooleanColumn @@ -1056,20 +925,12 @@ public function updateBooleanAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeBoolean::from($response); - } /** * Create a date time attribute according to the ISO 8601 standard. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeDatetime * * @deprecated This API has been deprecated since 1.8.0. Please use `createDatetimeColumn` instead. * @see TablesDB::createDatetimeColumn @@ -1110,21 +971,13 @@ public function createDatetimeAttribute(string $databaseId, string $collectionId } return \Appwrite\Models\AttributeDatetime::from($response); - } /** * Update a date time attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeDatetime * * @deprecated This API has been deprecated since 1.8.0. Please use `updateDatetimeColumn` instead. * @see TablesDB::updateDatetimeColumn @@ -1162,21 +1015,12 @@ public function updateDatetimeAttribute(string $databaseId, string $collectionId } return \Appwrite\Models\AttributeDatetime::from($response); - } /** * Create an email attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeEmail * * @deprecated This API has been deprecated since 1.8.0. Please use `createEmailColumn` instead. * @see TablesDB::createEmailColumn @@ -1217,22 +1061,13 @@ public function createEmailAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributeEmail::from($response); - } /** * Update an email attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeEmail * * @deprecated This API has been deprecated since 1.8.0. Please use `updateEmailColumn` instead. * @see TablesDB::updateEmailColumn @@ -1270,23 +1105,13 @@ public function updateEmailAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributeEmail::from($response); - } /** * Create an enum attribute. The `elements` param acts as a white-list of - * accepted values for this attribute. - * + * accepted values for this attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param array $elements - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeEnum * * @deprecated This API has been deprecated since 1.8.0. Please use `createEnumColumn` instead. * @see TablesDB::createEnumColumn @@ -1328,23 +1153,13 @@ public function createEnumAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeEnum::from($response); - } /** * Update an enum attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param array $elements - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeEnum * * @deprecated This API has been deprecated since 1.8.0. Please use `updateEnumColumn` instead. * @see TablesDB::updateEnumColumn @@ -1383,24 +1198,13 @@ public function updateEnumAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeEnum::from($response); - } /** * Create a float attribute. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?float $min - * @param ?float $max - * @param ?float $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeFloat * * @deprecated This API has been deprecated since 1.8.0. Please use `createFloatColumn` instead. * @see TablesDB::createFloatColumn @@ -1443,24 +1247,13 @@ public function createFloatAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributeFloat::from($response); - } /** * Update a float attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?float $xdefault - * @param ?float $min - * @param ?float $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeFloat * * @deprecated This API has been deprecated since 1.8.0. Please use `updateFloatColumn` instead. * @see TablesDB::updateFloatColumn @@ -1500,24 +1293,13 @@ public function updateFloatAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributeFloat::from($response); - } /** * Create an integer attribute. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?int $min - * @param ?int $max - * @param ?int $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeInteger * * @deprecated This API has been deprecated since 1.8.0. Please use `createIntegerColumn` instead. * @see TablesDB::createIntegerColumn @@ -1560,24 +1342,13 @@ public function createIntegerAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeInteger::from($response); - } /** * Update an integer attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?int $xdefault - * @param ?int $min - * @param ?int $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeInteger * * @deprecated This API has been deprecated since 1.8.0. Please use `updateIntegerColumn` instead. * @see TablesDB::updateIntegerColumn @@ -1617,21 +1388,12 @@ public function updateIntegerAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeInteger::from($response); - } /** * Create IP address attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeIp * * @deprecated This API has been deprecated since 1.8.0. Please use `createIpColumn` instead. * @see TablesDB::createIpColumn @@ -1672,22 +1434,13 @@ public function createIpAttribute(string $databaseId, string $collectionId, stri } return \Appwrite\Models\AttributeIp::from($response); - } /** * Update an ip attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeIp * * @deprecated This API has been deprecated since 1.8.0. Please use `updateIpColumn` instead. * @see TablesDB::updateIpColumn @@ -1725,19 +1478,12 @@ public function updateIpAttribute(string $databaseId, string $collectionId, stri } return \Appwrite\Models\AttributeIp::from($response); - } /** * Create a geometric line attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\AttributeLine * * @deprecated This API has been deprecated since 1.8.0. Please use `createLineColumn` instead. * @see TablesDB::createLineColumn @@ -1774,21 +1520,13 @@ public function createLineAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeLine::from($response); - } /** * Update a line attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeLine * * @deprecated This API has been deprecated since 1.8.0. Please use `updateLineColumn` instead. * @see TablesDB::updateLineColumn @@ -1826,22 +1564,12 @@ public function updateLineAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeLine::from($response); - } /** * Create a longtext attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeLongtext * * @deprecated This API has been deprecated since 1.8.0. Please use `createLongtextColumn` instead. * @see TablesDB::createLongtextColumn @@ -1886,22 +1614,13 @@ public function createLongtextAttribute(string $databaseId, string $collectionId } return \Appwrite\Models\AttributeLongtext::from($response); - } /** * Update a longtext attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeLongtext * * @deprecated This API has been deprecated since 1.8.0. Please use `updateLongtextColumn` instead. * @see TablesDB::updateLongtextColumn @@ -1939,22 +1658,12 @@ public function updateLongtextAttribute(string $databaseId, string $collectionId } return \Appwrite\Models\AttributeLongtext::from($response); - } /** * Create a mediumtext attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeMediumtext * * @deprecated This API has been deprecated since 1.8.0. Please use `createMediumtextColumn` instead. * @see TablesDB::createMediumtextColumn @@ -1999,22 +1708,13 @@ public function createMediumtextAttribute(string $databaseId, string $collection } return \Appwrite\Models\AttributeMediumtext::from($response); - } /** * Update a mediumtext attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeMediumtext * * @deprecated This API has been deprecated since 1.8.0. Please use `updateMediumtextColumn` instead. * @see TablesDB::updateMediumtextColumn @@ -2052,19 +1752,12 @@ public function updateMediumtextAttribute(string $databaseId, string $collection } return \Appwrite\Models\AttributeMediumtext::from($response); - } /** * Create a geometric point attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\AttributePoint * * @deprecated This API has been deprecated since 1.8.0. Please use `createPointColumn` instead. * @see TablesDB::createPointColumn @@ -2101,21 +1794,13 @@ public function createPointAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributePoint::from($response); - } /** * Update a point attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributePoint * * @deprecated This API has been deprecated since 1.8.0. Please use `updatePointColumn` instead. * @see TablesDB::updatePointColumn @@ -2153,19 +1838,12 @@ public function updatePointAttribute(string $databaseId, string $collectionId, s } return \Appwrite\Models\AttributePoint::from($response); - } /** * Create a geometric polygon attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\AttributePolygon * * @deprecated This API has been deprecated since 1.8.0. Please use `createPolygonColumn` instead. * @see TablesDB::createPolygonColumn @@ -2202,21 +1880,13 @@ public function createPolygonAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributePolygon::from($response); - } /** * Update a polygon attribute. Changing the `default` value will not update * already existing documents. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributePolygon * * @deprecated This API has been deprecated since 1.8.0. Please use `updatePolygonColumn` instead. * @see TablesDB::updatePolygonColumn @@ -2254,24 +1924,13 @@ public function updatePolygonAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributePolygon::from($response); - } /** * Create relationship attribute. [Learn more about relationship * attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - * * - * @param string $databaseId - * @param string $collectionId - * @param string $relatedCollectionId - * @param RelationshipType $type - * @param ?bool $twoWay - * @param ?string $key - * @param ?string $twoWayKey - * @param ?RelationMutate $onDelete * @throws AppwriteException - * @return \Appwrite\Models\AttributeRelationship * * @deprecated This API has been deprecated since 1.8.0. Please use `createRelationshipColumn` instead. * @see TablesDB::createRelationshipColumn @@ -2317,21 +1976,13 @@ public function createRelationshipAttribute(string $databaseId, string $collecti } return \Appwrite\Models\AttributeRelationship::from($response); - } /** * Update relationship attribute. [Learn more about relationship * attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param ?RelationMutate $onDelete - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeRelationship * * @deprecated This API has been deprecated since 1.8.0. Please use `updateRelationshipColumn` instead. * @see TablesDB::updateRelationshipColumn @@ -2371,23 +2022,12 @@ public function updateRelationshipAttribute(string $databaseId, string $collecti } return \Appwrite\Models\AttributeRelationship::from($response); - } /** * Create a string attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param int $size - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeString * * @deprecated This API has been deprecated since 1.8.0. Please use `createStringColumn` instead. * @see TablesDB::createStringColumn @@ -2433,23 +2073,13 @@ public function createStringAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeString::from($response); - } /** * Update a string attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?int $size - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeString * * @deprecated This API has been deprecated since 1.8.0. Please use `updateStringColumn` instead. * @see TablesDB::updateStringColumn @@ -2488,22 +2118,12 @@ public function updateStringAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeString::from($response); - } /** * Create a text attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeText * * @deprecated This API has been deprecated since 1.8.0. Please use `createTextColumn` instead. * @see TablesDB::createTextColumn @@ -2548,22 +2168,13 @@ public function createTextAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeText::from($response); - } /** * Update a text attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeText * * @deprecated This API has been deprecated since 1.8.0. Please use `updateTextColumn` instead. * @see TablesDB::updateTextColumn @@ -2601,21 +2212,12 @@ public function updateTextAttribute(string $databaseId, string $collectionId, st } return \Appwrite\Models\AttributeText::from($response); - } /** * Create a URL attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\AttributeUrl * * @deprecated This API has been deprecated since 1.8.0. Please use `createUrlColumn` instead. * @see TablesDB::createUrlColumn @@ -2656,22 +2258,13 @@ public function createUrlAttribute(string $databaseId, string $collectionId, str } return \Appwrite\Models\AttributeUrl::from($response); - } /** * Update an url attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeUrl * * @deprecated This API has been deprecated since 1.8.0. Please use `updateUrlColumn` instead. * @see TablesDB::updateUrlColumn @@ -2709,23 +2302,12 @@ public function updateUrlAttribute(string $databaseId, string $collectionId, str } return \Appwrite\Models\AttributeUrl::from($response); - } /** * Create a varchar attribute. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param int $size - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\AttributeVarchar * * @deprecated This API has been deprecated since 1.8.0. Please use `createVarcharColumn` instead. * @see TablesDB::createVarcharColumn @@ -2771,23 +2353,13 @@ public function createVarcharAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeVarchar::from($response); - } /** * Update a varchar attribute. Changing the `default` value will not update * already existing documents. - * * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?int $size - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\AttributeVarchar * * @deprecated This API has been deprecated since 1.8.0. Please use `updateVarcharColumn` instead. * @see TablesDB::updateVarcharColumn @@ -2826,17 +2398,12 @@ public function updateVarcharAttribute(string $databaseId, string $collectionId, } return \Appwrite\Models\AttributeVarchar::from($response); - } /** * Get attribute by ID. * - * @param string $databaseId - * @param string $collectionId - * @param string $key * @throws AppwriteException - * @return \Appwrite\Models\AttributeBoolean|\Appwrite\Models\AttributeInteger|\Appwrite\Models\AttributeFloat|\Appwrite\Models\AttributeEmail|\Appwrite\Models\AttributeEnum|\Appwrite\Models\AttributeUrl|\Appwrite\Models\AttributeIp|\Appwrite\Models\AttributeDatetime|\Appwrite\Models\AttributeRelationship|\Appwrite\Models\AttributeString * * @deprecated This API has been deprecated since 1.8.0. Please use `getColumn` instead. * @see TablesDB::getColumn @@ -2910,17 +2477,12 @@ public function getAttribute(string $databaseId, string $collectionId, string $k } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Deletes an attribute. * - * @param string $databaseId - * @param string $collectionId - * @param string $key * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteColumn` instead. * @see TablesDB::deleteColumn @@ -2942,29 +2504,19 @@ public function deleteAttribute(string $databaseId, string $collectionId, string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all the user's documents in a given collection. You can use * the query params to filter your results. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $queries - * @param ?string $transactionId - * @param ?bool $total - * @param ?int $ttl * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `listRows` instead. * @see TablesDB::listRows @@ -3013,7 +2565,6 @@ public function listDocuments(string $databaseId, string $collectionId, ?array $ } return \Appwrite\Models\DocumentList::from($response); - } /** @@ -3022,14 +2573,7 @@ public function listDocuments(string $databaseId, string $collectionId, ?array $ * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `createRow` instead. * @see TablesDB::createRow @@ -3067,7 +2611,6 @@ public function createDocument(string $databaseId, string $collectionId, string } return \Appwrite\Models\Document::from($response); - } /** @@ -3076,12 +2619,7 @@ public function createDocument(string $databaseId, string $collectionId, string * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. * - * @param string $databaseId - * @param string $collectionId - * @param array $documents - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `createRows` instead. * @see TablesDB::createRows @@ -3117,7 +2655,6 @@ public function createDocuments(string $databaseId, string $collectionId, array } return \Appwrite\Models\DocumentList::from($response); - } /** @@ -3125,14 +2662,8 @@ public function createDocuments(string $databaseId, string $collectionId, array * new collection resource using either a [server * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. - * * - * @param string $databaseId - * @param string $collectionId - * @param array $documents - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `upsertRows` instead. * @see TablesDB::upsertRows @@ -3168,7 +2699,6 @@ public function upsertDocuments(string $databaseId, string $collectionId, array } return \Appwrite\Models\DocumentList::from($response); - } /** @@ -3176,13 +2706,7 @@ public function upsertDocuments(string $databaseId, string $collectionId, array * then all documents are updated. You can pass only specific fields to be * updated. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $data - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `updateRows` instead. * @see TablesDB::updateRows @@ -3225,19 +2749,13 @@ public function updateDocuments(string $databaseId, string $collectionId, ?array } return \Appwrite\Models\DocumentList::from($response); - } /** * Bulk delete documents using queries, if no queries are passed then all * documents are deleted. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\DocumentList * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteRows` instead. * @see TablesDB::deleteRows @@ -3279,20 +2797,13 @@ public function deleteDocuments(string $databaseId, string $collectionId, ?array } return \Appwrite\Models\DocumentList::from($response); - } /** * Get a document by its unique ID. This endpoint response returns a JSON * object with the document data. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `getRow` instead. * @see TablesDB::getRow @@ -3334,7 +2845,6 @@ public function getDocument(string $databaseId, string $collectionId, string $do } return \Appwrite\Models\Document::from($response); - } /** @@ -3343,14 +2853,7 @@ public function getDocument(string $databaseId, string $collectionId, string $do * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) * API or directly from your database console. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param ?array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `upsertRow` instead. * @see TablesDB::upsertRow @@ -3391,21 +2894,13 @@ public function upsertDocument(string $databaseId, string $collectionId, string } return \Appwrite\Models\Document::from($response); - } /** * Update a document by its unique ID. Using the patch method you can pass * only specific fields that will get updated. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param ?array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `updateRow` instead. * @see TablesDB::updateRow @@ -3446,18 +2941,12 @@ public function updateDocument(string $databaseId, string $collectionId, string } return \Appwrite\Models\Document::from($response); - } /** * Delete a document by its unique ID. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param ?string $transactionId * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteRow` instead. * @see TablesDB::deleteRow @@ -3483,29 +2972,18 @@ public function deleteDocument(string $databaseId, string $collectionId, string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Decrement a specific attribute of a document by a given value. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param string $attribute - * @param ?float $value - * @param ?float $min - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `decrementRowColumn` instead. * @see TablesDB::decrementRowColumn @@ -3547,21 +3025,12 @@ public function decrementDocumentAttribute(string $databaseId, string $collectio } return \Appwrite\Models\Document::from($response); - } /** * Increment a specific attribute of a document by a given value. * - * @param string $databaseId - * @param string $collectionId - * @param string $documentId - * @param string $attribute - * @param ?float $value - * @param ?float $max - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Document * * @deprecated This API has been deprecated since 1.8.0. Please use `incrementRowColumn` instead. * @see TablesDB::incrementRowColumn @@ -3603,18 +3072,12 @@ public function incrementDocumentAttribute(string $databaseId, string $collectio } return \Appwrite\Models\Document::from($response); - } /** * List indexes in the collection. * - * @param string $databaseId - * @param string $collectionId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\IndexList * * @deprecated This API has been deprecated since 1.8.0. Please use `listIndexes` instead. * @see TablesDB::listIndexes @@ -3655,7 +3118,6 @@ public function listIndexes(string $databaseId, string $collectionId, ?array $qu } return \Appwrite\Models\IndexList::from($response); - } /** @@ -3663,15 +3125,7 @@ public function listIndexes(string $databaseId, string $collectionId, ?array $qu * the attributes you will query in a single request. * Attributes can be `key`, `fulltext`, and `unique`. * - * @param string $databaseId - * @param string $collectionId - * @param string $key - * @param DatabasesIndexType $type - * @param array $attributes - * @param ?array $orders - * @param ?array $lengths * @throws AppwriteException - * @return \Appwrite\Models\Index * * @deprecated This API has been deprecated since 1.8.0. Please use `createIndex` instead. * @see TablesDB::createIndex @@ -3716,17 +3170,12 @@ public function createIndex(string $databaseId, string $collectionId, string $ke } return \Appwrite\Models\Index::from($response); - } /** * Get an index by its unique ID. * - * @param string $databaseId - * @param string $collectionId - * @param string $key * @throws AppwriteException - * @return \Appwrite\Models\Index * * @deprecated This API has been deprecated since 1.8.0. Please use `getIndex` instead. * @see TablesDB::getIndex @@ -3760,17 +3209,12 @@ public function getIndex(string $databaseId, string $collectionId, string $key): } return \Appwrite\Models\Index::from($response); - } /** * Delete an index. * - * @param string $databaseId - * @param string $collectionId - * @param string $key * @throws AppwriteException - * @return string * * @deprecated This API has been deprecated since 1.8.0. Please use `deleteIndex` instead. * @see TablesDB::deleteIndex @@ -3792,14 +3236,11 @@ public function deleteIndex(string $databaseId, string $collectionId, string $ke $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Embeddings.php b/src/Appwrite/Services/Embeddings.php index f1f65d2c..10932d8a 100644 --- a/src/Appwrite/Services/Embeddings.php +++ b/src/Appwrite/Services/Embeddings.php @@ -1,30 +1,22 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the function active deployment. Use this endpoint to switch the code * deployment that should be used when visitor opens your function. * - * @param string $functionId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\FunctionModel */ public function updateFunctionDeployment(string $functionId, string $deploymentId): \Appwrite\Models\FunctionModel { @@ -519,19 +447,13 @@ public function updateFunctionDeployment(string $functionId, string $deploymentI } return \Appwrite\Models\FunctionModel::from($response); - } /** * Get a list of all the function's code deployments. You can use the query * params to filter your results. * - * @param string $functionId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\DeploymentList */ public function listDeployments(string $functionId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\DeploymentList { @@ -572,28 +494,21 @@ public function listDeployments(string $functionId, ?array $queries = null, ?str } return \Appwrite\Models\DeploymentList::from($response); - } /** * Create a new function code deployment. Use this endpoint to upload a new * version of your code function. To execute your newly uploaded code, you'll * need to update the function's deployment to use your new deployment UID. - * + * * This endpoint accepts a tar.gz file compressed with your code. Make sure to * include any dependencies your code has within the compressed file. You can * learn more about code packaging in the [Appwrite Cloud Functions * tutorial](https://appwrite.io/docs/functions). - * + * * Use the "command" param to set the entrypoint used to execute your code. * - * @param string $functionId - * @param InputFile $code - * @param bool $activate - * @param ?string $entrypoint - * @param ?string $commands * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createDeployment(string $functionId, InputFile $code, bool $activate, ?string $entrypoint = null, ?string $commands = null, ?callable $onProgress = null): \Appwrite\Models\Deployment { @@ -623,12 +538,12 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $size = 0; $mimeType = null; $postedName = null; - if(empty($code->getPath() ?? null)) { + if (empty($code->getPath() ?? null)) { $size = strlen($code->getData()); $mimeType = $code->getMimeType(); $postedName = $code->getFilename(); if ($size <= Client::CHUNK_SIZE) { - $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($code->getData()), $mimeType, $postedName); + $apiParams['code'] = Part::body('code', $code->getData(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -645,7 +560,7 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $postedName = $code->getFilename() ?? basename($code->getPath()); //send single file if size is less than or equal to 5MB if ($size <= Client::CHUNK_SIZE) { - $apiParams['code'] = new \CURLFile($code->getPath(), $mimeType, $postedName); + $apiParams['code'] = Part::file('code', $code->getPath(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -658,7 +573,6 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti } } - $id = ''; $counter = 0; @@ -669,12 +583,12 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti ]; $handle = null; - if(!empty($code->getPath())) { + if (!empty($code->getPath())) { $handle = @fopen($code->getPath(), "rb"); } $uploadId = ''; - $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { @@ -687,8 +601,8 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $start += Client::CHUNK_SIZE; } - $readChunk = function(int $start, int $end) use ($handle, $code) { - if(!empty($handle)) { + $readChunk = function (int $start, int $end) use ($handle, $code): string|false { + if (!empty($handle)) { fseek($handle, $start); return @fread($handle, $end - $start); } @@ -696,173 +610,67 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti return substr($code->getData(), $start, $end - $start); }; - $uploadChunk = function(array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { + $uploadChunk = function (array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { $chunkParams = $apiParams; $chunkHeaders = $apiHeaders; $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); + if (!is_string($data)) { + throw new AppwriteException('Failed to read upload chunk'); + } + $chunkParams['code'] = Part::body('code', $data, $postedName, $mimeType); $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($currentUploadId)) { + if (!empty($currentUploadId)) { $chunkHeaders['x-appwrite-id'] = $currentUploadId; } return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); }; - $isUploadComplete = function($chunkResponse) use ($totalChunks): bool { - if(!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { + $isUploadComplete = function ($chunkResponse) use ($totalChunks): bool { + if (!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { return false; } return (int) $chunkResponse['chunksUploaded'] >= (int) ($chunkResponse['chunksTotal'] ?? $totalChunks); }; - if (!empty($chunks)) { - $response = $uploadChunk($chunks[0], $uploadId); - if(empty($uploadId)) { - $uploadId = $response['$id']; + $response = $uploadChunk($chunks[0], $uploadId); + $uploadId = $response['$id']; + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; + if ($onProgress !== null) { + $onProgress([ + '$id' => $response['$id'], + 'progress' => $uploadedSize / $size * 100, + 'sizeUploaded' => $uploadedSize, + 'chunksTotal' => $totalChunks, + 'chunksUploaded' => $completedCount, + ]); + } + + $remainingChunks = array_slice($chunks, 1); + $completedResponse = $isUploadComplete($response) ? $response : null; + + foreach ($remainingChunks as $chunk) { + $response = $uploadChunk($chunk, $uploadId); + $completedCount++; + $uploadedSize += $chunk['end'] - $chunk['start']; + if ($isUploadComplete($response)) { + $completedResponse = $response; } - $completedCount = $chunks[0]['index'] + 1; - $uploadedSize = $chunks[0]['end']; - if($onProgress !== null) { + if ($onProgress !== null) { $onProgress([ - '$id' => $response['$id'], + '$id' => $uploadId, 'progress' => $uploadedSize / $size * 100, 'sizeUploaded' => $uploadedSize, 'chunksTotal' => $totalChunks, 'chunksUploaded' => $completedCount, ]); } - - $remainingChunks = array_slice($chunks, 1); - $clientConfig = \Closure::bind(function() { - if (property_exists($this, 'key') && $this->key !== null) { - $this->headers['authorization'] = $this->getAuthorization(); - } - - return [$this->endpoint, $this->headers, $this->selfSigned, $this->timeout, $this->connectTimeout]; - }, $this->client, Client::class); - $flattenParams = \Closure::bind(function(array $params): array { - return $this->flatten($params); - }, $this->client, Client::class); - [$endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout] = $clientConfig(); - $responseHeaders = []; - $lastResponse = $response; - $completedResponse = null; - - $makeHandle = function(array $chunk) use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size, $uploadId, $endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout, $flattenParams, &$responseHeaders) { - $chunkParams = $apiParams; - $chunkHeaders = array_merge($globalHeaders, $apiHeaders); - $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); - $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($uploadId)) { - $chunkHeaders['x-appwrite-id'] = $uploadId; - } - - $headers = []; - foreach ($chunkHeaders as $key => $value) { - $headers[] = $key . ':' . $value; - } - - $ch = curl_init($endpoint . $apiPath); - $responseHeaders[spl_object_id($ch)] = []; - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, Client::METHOD_POST); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $flattenParams($chunkParams)); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $length = strlen($header); - $header = explode(':', strtolower($header), 2); - if (count($header) >= 2) { - $responseHeaders[spl_object_id($curl)][strtolower(trim($header[0]))] = trim($header[1]); - } - - return $length; - }); - if($selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - } - if($timeout !== null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - } - if($connectTimeout !== null) { - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connectTimeout); - } - - return $ch; - }; - - $nextChunk = 0; - while ($nextChunk < count($remainingChunks)) { - $multiHandle = curl_multi_init(); - $handles = []; - for ($i = 0; $i < 8 && $nextChunk < count($remainingChunks); $i++, $nextChunk++) { - $chunk = $remainingChunks[$nextChunk]; - $ch = $makeHandle($chunk); - $handles[spl_object_id($ch)] = ['handle' => $ch, 'chunk' => $chunk]; - curl_multi_add_handle($multiHandle, $ch); - } - - try { - do { - $status = curl_multi_exec($multiHandle, $active); - if ($active) { - curl_multi_select($multiHandle); - } - } while ($active && ($status == CURLM_OK || $status == CURLM_CALL_MULTI_PERFORM)); - - foreach ($handles as $handleInfo) { - $ch = $handleInfo['handle']; - $body = curl_multi_getcontent($ch); - $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $contentType = $responseHeaders[spl_object_id($ch)]['content-type'] ?? ''; - - if (curl_errno($ch)) { - throw new AppwriteException(curl_error($ch), $statusCode, '', $body); - } - - $chunkResponse = str_starts_with($contentType, 'application/json') ? json_decode($body, true) : $body; - - if($statusCode >= 400) { - if(is_array($chunkResponse)) { - throw new AppwriteException($chunkResponse['message'], $statusCode, $chunkResponse['type'] ?? '', json_encode($chunkResponse)); - } - - throw new AppwriteException($chunkResponse, $statusCode, '', $chunkResponse); - } - - $completedCount++; - $uploadedSize += $handleInfo['chunk']['end'] - $handleInfo['chunk']['start']; - $lastResponse = $chunkResponse; - if($isUploadComplete($chunkResponse)) { - $completedResponse = $chunkResponse; - } - if($onProgress !== null) { - $onProgress([ - '$id' => $uploadId, - 'progress' => $uploadedSize / $size * 100, - 'sizeUploaded' => $uploadedSize, - 'chunksTotal' => $totalChunks, - 'chunksUploaded' => $completedCount, - ]); - } - } - } finally { - foreach ($handles as $handleInfo) { - curl_multi_remove_handle($multiHandle, $handleInfo['handle']); - curl_close($handleInfo['handle']); - } - curl_multi_close($multiHandle); - } - } - $response = $completedResponse ?? $lastResponse; - } - if(!empty($handle)) { + + $response = $completedResponse ?? $response; + if (!empty($handle)) { @fclose($handle); } if (!is_array($response)) { @@ -870,7 +678,6 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti } return \Appwrite\Models\Deployment::from($response); - } /** @@ -880,11 +687,7 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti * build process will be queued and executed asynchronously. The original * deployment's code will be preserved and used for the new build. * - * @param string $functionId - * @param string $deploymentId - * @param ?string $buildId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createDuplicateDeployment(string $functionId, string $deploymentId, ?string $buildId = null): \Appwrite\Models\Deployment { @@ -919,25 +722,16 @@ public function createDuplicateDeployment(string $functionId, string $deployment } return \Appwrite\Models\Deployment::from($response); - } /** * Create a deployment based on a template. - * + * * Use this endpoint with combination of * [listTemplates](https://appwrite.io/docs/products/functions/templates) to * find the template details. * - * @param string $functionId - * @param string $repository - * @param string $owner - * @param string $rootDirectory - * @param TemplateReferenceType $type - * @param string $reference - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createTemplateDeployment(string $functionId, string $repository, string $owner, string $rootDirectory, TemplateReferenceType $type, string $reference, ?bool $activate = null): \Appwrite\Models\Deployment { @@ -976,20 +770,14 @@ public function createTemplateDeployment(string $functionId, string $repository, } return \Appwrite\Models\Deployment::from($response); - } /** * Create a deployment when a function is connected to VCS. - * + * * This endpoint lets you create deployment from a branch, commit, or a tag. * - * @param string $functionId - * @param VCSReferenceType $type - * @param string $reference - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createVcsDeployment(string $functionId, VCSReferenceType $type, string $reference, ?bool $activate = null): \Appwrite\Models\Deployment { @@ -1025,16 +813,12 @@ public function createVcsDeployment(string $functionId, VCSReferenceType $type, } return \Appwrite\Models\Deployment::from($response); - } /** * Get a function deployment by its unique ID. * - * @param string $functionId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function getDeployment(string $functionId, string $deploymentId): \Appwrite\Models\Deployment { @@ -1064,16 +848,12 @@ public function getDeployment(string $functionId, string $deploymentId): \Appwri } return \Appwrite\Models\Deployment::from($response); - } /** * Delete a code deployment by its unique ID. * - * @param string $functionId - * @param string $deploymentId * @throws AppwriteException - * @return string */ public function deleteDeployment(string $functionId, string $deploymentId): string { @@ -1091,15 +871,12 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1107,12 +884,7 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri * return with a 'Content-Disposition: attachment' header that tells the * browser to start downloading the file to user downloads directory. * - * @param string $functionId - * @param string $deploymentId - * @param ?DeploymentDownloadType $type - * @param ?string $token * @throws AppwriteException - * @return string */ public function getDeploymentDownload(string $functionId, string $deploymentId, ?DeploymentDownloadType $type = null, ?string $token = null): string { @@ -1138,15 +910,12 @@ public function getDeploymentDownload(string $functionId, string $deploymentId, $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1156,10 +925,7 @@ public function getDeploymentDownload(string $functionId, string $deploymentId, * cancel builds that have already completed (status 'ready') or failed. The * response includes the final build status and details. * - * @param string $functionId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function updateDeploymentStatus(string $functionId, string $deploymentId): \Appwrite\Models\Deployment { @@ -1190,18 +956,13 @@ public function updateDeploymentStatus(string $functionId, string $deploymentId) } return \Appwrite\Models\Deployment::from($response); - } /** * Get a list of all the current user function execution logs. You can use the * query params to filter your results. * - * @param string $functionId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ExecutionList */ public function listExecutions(string $functionId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\ExecutionList { @@ -1238,7 +999,6 @@ public function listExecutions(string $functionId, ?array $queries = null, ?bool } return \Appwrite\Models\ExecutionList::from($response); - } /** @@ -1247,15 +1007,7 @@ public function listExecutions(string $functionId, ?array $queries = null, ?bool * updates on the current execution status. Once this endpoint is called, your * function execution process will start asynchronously. * - * @param string $functionId - * @param ?string $body - * @param ?bool $async - * @param ?string $xpath - * @param ?ExecutionMethod $method - * @param ?array $headers - * @param ?string $scheduledAt * @throws AppwriteException - * @return \Appwrite\Models\Execution */ public function createExecution(string $functionId, ?string $body = null, ?bool $async = null, ?string $xpath = null, ?ExecutionMethod $method = null, ?array $headers = null, ?string $scheduledAt = null): \Appwrite\Models\Execution { @@ -1306,16 +1058,12 @@ public function createExecution(string $functionId, ?string $body = null, ?bool } return \Appwrite\Models\Execution::from($response); - } /** * Get a function execution log by its unique ID. * - * @param string $functionId - * @param string $executionId * @throws AppwriteException - * @return \Appwrite\Models\Execution */ public function getExecution(string $functionId, string $executionId): \Appwrite\Models\Execution { @@ -1345,16 +1093,12 @@ public function getExecution(string $functionId, string $executionId): \Appwrite } return \Appwrite\Models\Execution::from($response); - } /** * Delete a function execution by its unique ID. * - * @param string $functionId - * @param string $executionId * @throws AppwriteException - * @return string */ public function deleteExecution(string $functionId, string $executionId): string { @@ -1372,25 +1116,18 @@ public function deleteExecution(string $functionId, string $executionId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all variables of a specific function. * - * @param string $functionId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\VariableList */ public function listVariables(string $functionId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\VariableList { @@ -1427,20 +1164,13 @@ public function listVariables(string $functionId, ?array $queries = null, ?bool } return \Appwrite\Models\VariableList::from($response); - } /** * Create a new function environment variable. These variables can be accessed * in the function at runtime as environment variables. * - * @param string $functionId - * @param string $variableId - * @param string $key - * @param string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function createVariable(string $functionId, string $variableId, string $key, string $value, ?bool $secret = null): \Appwrite\Models\Variable { @@ -1477,16 +1207,12 @@ public function createVariable(string $functionId, string $variableId, string $k } return \Appwrite\Models\Variable::from($response); - } /** * Get a variable by its unique ID. * - * @param string $functionId - * @param string $variableId * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function getVariable(string $functionId, string $variableId): \Appwrite\Models\Variable { @@ -1516,19 +1242,12 @@ public function getVariable(string $functionId, string $variableId): \Appwrite\M } return \Appwrite\Models\Variable::from($response); - } /** * Update variable by its unique ID. * - * @param string $functionId - * @param string $variableId - * @param ?string $key - * @param ?string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function updateVariable(string $functionId, string $variableId, ?string $key = null, ?string $value = null, ?bool $secret = null): \Appwrite\Models\Variable { @@ -1562,16 +1281,12 @@ public function updateVariable(string $functionId, string $variableId, ?string $ } return \Appwrite\Models\Variable::from($response); - } /** * Delete a variable by its unique ID. * - * @param string $functionId - * @param string $variableId * @throws AppwriteException - * @return string */ public function deleteVariable(string $functionId, string $variableId): string { @@ -1589,14 +1304,11 @@ public function deleteVariable(string $functionId, string $variableId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Graphql.php b/src/Appwrite/Services/Graphql.php index 7be9c5c6..2bd16eae 100644 --- a/src/Appwrite/Services/Graphql.php +++ b/src/Appwrite/Services/Graphql.php @@ -1,25 +1,19 @@ client->call( + return $this->client->call( Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Execute a GraphQL mutation. * - * @param array $query * @throws AppwriteException - * @return array */ public function mutation(array $query): array { @@ -73,14 +62,11 @@ public function mutation(array $query): array $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Locale.php b/src/Appwrite/Services/Locale.php index a84457f7..6d0f10d5 100644 --- a/src/Appwrite/Services/Locale.php +++ b/src/Appwrite/Services/Locale.php @@ -1,29 +1,24 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of the targets associated with a message. * - * @param string $messageId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\TargetList */ public function listTargets(string $messageId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\TargetList { @@ -643,17 +530,12 @@ public function listTargets(string $messageId, ?array $queries = null, ?bool $to } return \Appwrite\Models\TargetList::from($response); - } /** * Get a list of all providers from the current Appwrite project. * - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ProviderList */ public function listProviders(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\ProviderList { @@ -693,22 +575,12 @@ public function listProviders(?array $queries = null, ?string $search = null, ?b } return \Appwrite\Models\ProviderList::from($response); - } /** * Create a new Apple Push Notification service provider. * - * @param string $providerId - * @param string $name - * @param ?string $authKey - * @param ?string $authKeyId - * @param ?string $teamId - * @param ?string $bundleId - * @param ?bool $sandbox - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createAPNSProvider(string $providerId, string $name, ?string $authKey = null, ?string $authKeyId = null, ?string $teamId = null, ?string $bundleId = null, ?bool $sandbox = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -760,22 +632,12 @@ public function createAPNSProvider(string $providerId, string $name, ?string $au } return \Appwrite\Models\Provider::from($response); - } /** * Update a Apple Push Notification service provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $authKey - * @param ?string $authKeyId - * @param ?string $teamId - * @param ?string $bundleId - * @param ?bool $sandbox * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateAPNSProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $authKey = null, ?string $authKeyId = null, ?string $teamId = null, ?string $bundleId = null, ?bool $sandbox = null): \Appwrite\Models\Provider { @@ -827,18 +689,12 @@ public function updateAPNSProvider(string $providerId, ?string $name = null, ?bo } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Firebase Cloud Messaging provider. * - * @param string $providerId - * @param string $name - * @param ?array $serviceAccountJSON - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createFCMProvider(string $providerId, string $name, ?array $serviceAccountJSON = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -871,18 +727,12 @@ public function createFCMProvider(string $providerId, string $name, ?array $serv } return \Appwrite\Models\Provider::from($response); - } /** * Update a Firebase Cloud Messaging provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?array $serviceAccountJSON * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateFCMProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?array $serviceAccountJSON = null): \Appwrite\Models\Provider { @@ -918,24 +768,12 @@ public function updateFCMProvider(string $providerId, ?string $name = null, ?boo } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Mailgun provider. * - * @param string $providerId - * @param string $name - * @param ?string $apiKey - * @param ?string $domain - * @param ?bool $isEuRegion - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createMailgunProvider(string $providerId, string $name, ?string $apiKey = null, ?string $domain = null, ?bool $isEuRegion = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -992,24 +830,12 @@ public function createMailgunProvider(string $providerId, string $name, ?string } return \Appwrite\Models\Provider::from($response); - } /** * Update a Mailgun provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?string $apiKey - * @param ?string $domain - * @param ?bool $isEuRegion - * @param ?bool $enabled - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateMailgunProvider(string $providerId, ?string $name = null, ?string $apiKey = null, ?string $domain = null, ?bool $isEuRegion = null, ?bool $enabled = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null): \Appwrite\Models\Provider { @@ -1069,20 +895,12 @@ public function updateMailgunProvider(string $providerId, ?string $name = null, } return \Appwrite\Models\Provider::from($response); - } /** * Create a new MSG91 provider. * - * @param string $providerId - * @param string $name - * @param ?string $templateId - * @param ?string $senderId - * @param ?string $authKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createMsg91Provider(string $providerId, string $name, ?string $templateId = null, ?string $senderId = null, ?string $authKey = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1126,20 +944,12 @@ public function createMsg91Provider(string $providerId, string $name, ?string $t } return \Appwrite\Models\Provider::from($response); - } /** * Update a MSG91 provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $templateId - * @param ?string $senderId - * @param ?string $authKey * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateMsg91Provider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $templateId = null, ?string $senderId = null, ?string $authKey = null): \Appwrite\Models\Provider { @@ -1186,22 +996,12 @@ public function updateMsg91Provider(string $providerId, ?string $name = null, ?b } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Resend provider. * - * @param string $providerId - * @param string $name - * @param ?string $apiKey - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createResendProvider(string $providerId, string $name, ?string $apiKey = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1253,22 +1053,12 @@ public function createResendProvider(string $providerId, string $name, ?string $ } return \Appwrite\Models\Provider::from($response); - } /** * Update a Resend provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $apiKey - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateResendProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $apiKey = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null): \Appwrite\Models\Provider { @@ -1323,22 +1113,12 @@ public function updateResendProvider(string $providerId, ?string $name = null, ? } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Sendgrid provider. * - * @param string $providerId - * @param string $name - * @param ?string $apiKey - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createSendgridProvider(string $providerId, string $name, ?string $apiKey = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1390,22 +1170,12 @@ public function createSendgridProvider(string $providerId, string $name, ?string } return \Appwrite\Models\Provider::from($response); - } /** * Update a Sendgrid provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $apiKey - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateSendgridProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $apiKey = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null): \Appwrite\Models\Provider { @@ -1460,24 +1230,12 @@ public function updateSendgridProvider(string $providerId, ?string $name = null, } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Amazon SES provider. * - * @param string $providerId - * @param string $name - * @param ?string $accessKey - * @param ?string $secretKey - * @param ?string $region - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createSesProvider(string $providerId, string $name, ?string $accessKey = null, ?string $secretKey = null, ?string $region = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1537,24 +1295,12 @@ public function createSesProvider(string $providerId, string $name, ?string $acc } return \Appwrite\Models\Provider::from($response); - } /** * Update an Amazon SES provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $accessKey - * @param ?string $secretKey - * @param ?string $region - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateSesProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $accessKey = null, ?string $secretKey = null, ?string $region = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null): \Appwrite\Models\Provider { @@ -1617,28 +1363,12 @@ public function updateSesProvider(string $providerId, ?string $name = null, ?boo } return \Appwrite\Models\Provider::from($response); - } /** * Create a new SMTP provider. * - * @param string $providerId - * @param string $name - * @param string $host - * @param ?int $port - * @param ?string $username - * @param ?string $password - * @param ?SmtpEncryption $encryption - * @param ?bool $autoTLS - * @param ?string $mailer - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createSMTPProvider(string $providerId, string $name, string $host, ?int $port = null, ?string $username = null, ?string $password = null, ?SmtpEncryption $encryption = null, ?bool $autoTLS = null, ?string $mailer = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1711,28 +1441,12 @@ public function createSMTPProvider(string $providerId, string $name, string $hos } return \Appwrite\Models\Provider::from($response); - } /** * Update a SMTP provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?string $host - * @param ?int $port - * @param ?string $username - * @param ?string $password - * @param ?SmtpEncryption $encryption - * @param ?bool $autoTLS - * @param ?string $mailer - * @param ?string $fromName - * @param ?string $fromEmail - * @param ?string $replyToName - * @param ?string $replyToEmail - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateSMTPProvider(string $providerId, ?string $name = null, ?string $host = null, ?int $port = null, ?string $username = null, ?string $password = null, ?SmtpEncryption $encryption = null, ?bool $autoTLS = null, ?string $mailer = null, ?string $fromName = null, ?string $fromEmail = null, ?string $replyToName = null, ?string $replyToEmail = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1805,20 +1519,12 @@ public function updateSMTPProvider(string $providerId, ?string $name = null, ?st } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Telesign provider. * - * @param string $providerId - * @param string $name - * @param ?string $from - * @param ?string $customerId - * @param ?string $apiKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createTelesignProvider(string $providerId, string $name, ?string $from = null, ?string $customerId = null, ?string $apiKey = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1862,20 +1568,12 @@ public function createTelesignProvider(string $providerId, string $name, ?string } return \Appwrite\Models\Provider::from($response); - } /** * Update a Telesign provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $customerId - * @param ?string $apiKey - * @param ?string $from * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateTelesignProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $customerId = null, ?string $apiKey = null, ?string $from = null): \Appwrite\Models\Provider { @@ -1922,20 +1620,12 @@ public function updateTelesignProvider(string $providerId, ?string $name = null, } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Textmagic provider. * - * @param string $providerId - * @param string $name - * @param ?string $from - * @param ?string $username - * @param ?string $apiKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createTextmagicProvider(string $providerId, string $name, ?string $from = null, ?string $username = null, ?string $apiKey = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -1979,20 +1669,12 @@ public function createTextmagicProvider(string $providerId, string $name, ?strin } return \Appwrite\Models\Provider::from($response); - } /** * Update a Textmagic provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $username - * @param ?string $apiKey - * @param ?string $from * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateTextmagicProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $username = null, ?string $apiKey = null, ?string $from = null): \Appwrite\Models\Provider { @@ -2039,20 +1721,12 @@ public function updateTextmagicProvider(string $providerId, ?string $name = null } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Twilio provider. * - * @param string $providerId - * @param string $name - * @param ?string $from - * @param ?string $accountSid - * @param ?string $authToken - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createTwilioProvider(string $providerId, string $name, ?string $from = null, ?string $accountSid = null, ?string $authToken = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -2096,20 +1770,12 @@ public function createTwilioProvider(string $providerId, string $name, ?string $ } return \Appwrite\Models\Provider::from($response); - } /** * Update a Twilio provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $accountSid - * @param ?string $authToken - * @param ?string $from * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateTwilioProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $accountSid = null, ?string $authToken = null, ?string $from = null): \Appwrite\Models\Provider { @@ -2156,20 +1822,12 @@ public function updateTwilioProvider(string $providerId, ?string $name = null, ? } return \Appwrite\Models\Provider::from($response); - } /** * Create a new Vonage provider. * - * @param string $providerId - * @param string $name - * @param ?string $from - * @param ?string $apiKey - * @param ?string $apiSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function createVonageProvider(string $providerId, string $name, ?string $from = null, ?string $apiKey = null, ?string $apiSecret = null, ?bool $enabled = null): \Appwrite\Models\Provider { @@ -2213,20 +1871,12 @@ public function createVonageProvider(string $providerId, string $name, ?string $ } return \Appwrite\Models\Provider::from($response); - } /** * Update a Vonage provider by its unique ID. * - * @param string $providerId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $apiKey - * @param ?string $apiSecret - * @param ?string $from * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function updateVonageProvider(string $providerId, ?string $name = null, ?bool $enabled = null, ?string $apiKey = null, ?string $apiSecret = null, ?string $from = null): \Appwrite\Models\Provider { @@ -2273,16 +1923,12 @@ public function updateVonageProvider(string $providerId, ?string $name = null, ? } return \Appwrite\Models\Provider::from($response); - } /** * Get a provider by its unique ID. - * * - * @param string $providerId * @throws AppwriteException - * @return \Appwrite\Models\Provider */ public function getProvider(string $providerId): \Appwrite\Models\Provider { @@ -2311,15 +1957,12 @@ public function getProvider(string $providerId): \Appwrite\Models\Provider } return \Appwrite\Models\Provider::from($response); - } /** * Delete a provider by its unique ID. * - * @param string $providerId * @throws AppwriteException - * @return string */ public function deleteProvider(string $providerId): string { @@ -2336,25 +1979,18 @@ public function deleteProvider(string $providerId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all topics from the current Appwrite project. * - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\TopicList */ public function listTopics(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\TopicList { @@ -2394,17 +2030,12 @@ public function listTopics(?array $queries = null, ?string $search = null, ?bool } return \Appwrite\Models\TopicList::from($response); - } /** * Create a new topic. * - * @param string $topicId - * @param string $name - * @param ?array $subscribe * @throws AppwriteException - * @return \Appwrite\Models\Topic */ public function createTopic(string $topicId, string $name, ?array $subscribe = null): \Appwrite\Models\Topic { @@ -2439,16 +2070,12 @@ public function createTopic(string $topicId, string $name, ?array $subscribe = n } return \Appwrite\Models\Topic::from($response); - } /** * Get a topic by its unique ID. - * * - * @param string $topicId * @throws AppwriteException - * @return \Appwrite\Models\Topic */ public function getTopic(string $topicId): \Appwrite\Models\Topic { @@ -2477,18 +2104,12 @@ public function getTopic(string $topicId): \Appwrite\Models\Topic } return \Appwrite\Models\Topic::from($response); - } /** * Update a topic by its unique ID. - * * - * @param string $topicId - * @param ?string $name - * @param ?array $subscribe * @throws AppwriteException - * @return \Appwrite\Models\Topic */ public function updateTopic(string $topicId, ?string $name = null, ?array $subscribe = null): \Appwrite\Models\Topic { @@ -2520,15 +2141,12 @@ public function updateTopic(string $topicId, ?string $name = null, ?array $subsc } return \Appwrite\Models\Topic::from($response); - } /** * Delete a topic by its unique ID. * - * @param string $topicId * @throws AppwriteException - * @return string */ public function deleteTopic(string $topicId): string { @@ -2545,26 +2163,18 @@ public function deleteTopic(string $topicId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all subscribers from the current Appwrite project. * - * @param string $topicId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\SubscriberList */ public function listSubscribers(string $topicId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\SubscriberList { @@ -2605,17 +2215,12 @@ public function listSubscribers(string $topicId, ?array $queries = null, ?string } return \Appwrite\Models\SubscriberList::from($response); - } /** * Create a new subscriber. * - * @param string $topicId - * @param string $subscriberId - * @param string $targetId * @throws AppwriteException - * @return \Appwrite\Models\Subscriber */ public function createSubscriber(string $topicId, string $subscriberId, string $targetId): \Appwrite\Models\Subscriber { @@ -2647,17 +2252,12 @@ public function createSubscriber(string $topicId, string $subscriberId, string $ } return \Appwrite\Models\Subscriber::from($response); - } /** * Get a subscriber by its unique ID. - * * - * @param string $topicId - * @param string $subscriberId * @throws AppwriteException - * @return \Appwrite\Models\Subscriber */ public function getSubscriber(string $topicId, string $subscriberId): \Appwrite\Models\Subscriber { @@ -2687,16 +2287,12 @@ public function getSubscriber(string $topicId, string $subscriberId): \Appwrite\ } return \Appwrite\Models\Subscriber::from($response); - } /** * Delete a subscriber by its unique ID. * - * @param string $topicId - * @param string $subscriberId * @throws AppwriteException - * @return string */ public function deleteSubscriber(string $topicId, string $subscriberId): string { @@ -2714,14 +2310,11 @@ public function deleteSubscriber(string $topicId, string $subscriberId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Oauth2.php b/src/Appwrite/Services/Oauth2.php index bc4d8614..918ac8f9 100644 --- a/src/Appwrite/Services/Oauth2.php +++ b/src/Appwrite/Services/Oauth2.php @@ -1,19 +1,15 @@ client->call( + return $this->client->call( Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Exchange an OAuth2 authorization code, refresh token, or device code for * access and refresh tokens. * - * @param string $grantType - * @param ?string $code - * @param ?string $refreshToken - * @param ?string $deviceCode - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $codeVerifier - * @param ?string $redirectUri - * @param ?string $resource - * @param ?string $audience * @throws AppwriteException - * @return \Appwrite\Models\Oauth2Token */ public function createToken(string $grantType, ?string $code = null, ?string $refreshToken = null, ?string $deviceCode = null, ?string $clientId = null, ?string $clientSecret = null, ?string $codeVerifier = null, ?string $redirectUri = null, ?string $resource = null, ?string $audience = null): \Appwrite\Models\Oauth2Token { @@ -777,6 +676,5 @@ public function createToken(string $grantType, ?string $code = null, ?string $re } return \Appwrite\Models\Oauth2Token::from($response); - } } diff --git a/src/Appwrite/Services/Organization.php b/src/Appwrite/Services/Organization.php index 7c189a8f..271df32f 100644 --- a/src/Appwrite/Services/Organization.php +++ b/src/Appwrite/Services/Organization.php @@ -1,26 +1,20 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List app installations on the organization. Any organization member can * read installations. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppInstallationList */ public function listInstallations(?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList { @@ -164,7 +147,6 @@ public function listInstallations(?array $queries = null, ?bool $total = null): } return \Appwrite\Models\AppInstallationList::from($response); - } /** @@ -172,10 +154,7 @@ public function listInstallations(?array $queries = null, ?bool $total = null): * owner role can install apps. The installation is granted the scopes the app * currently requests. * - * @param string $appId - * @param ?string $authorizationDetails * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function createInstallation(string $appId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation { @@ -209,16 +188,13 @@ public function createInstallation(string $appId, ?string $authorizationDetails } return \Appwrite\Models\AppInstallation::from($response); - } /** * Get an app installation on the organization by its unique ID. Any * organization member can read installations. * - * @param string $installationId * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function getInstallation(string $installationId): \Appwrite\Models\AppInstallation { @@ -247,7 +223,6 @@ public function getInstallation(string $installationId): \Appwrite\Models\AppIns } return \Appwrite\Models\AppInstallation::from($response); - } /** @@ -256,10 +231,7 @@ public function getInstallation(string $installationId): \Appwrite\Models\AppIns * scopes are refreshed to the scopes the app currently requests; previously * issued installation access tokens are revoked. * - * @param string $installationId - * @param ?string $authorizationDetails * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function updateInstallation(string $installationId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation { @@ -290,7 +262,6 @@ public function updateInstallation(string $installationId, ?string $authorizatio } return \Appwrite\Models\AppInstallation::from($response); - } /** @@ -298,9 +269,7 @@ public function updateInstallation(string $installationId, ?string $authorizatio * organization members with the owner role can remove installations. * Previously issued installation access tokens are revoked. * - * @param string $installationId * @throws AppwriteException - * @return string */ public function deleteInstallation(string $installationId): string { @@ -318,24 +287,18 @@ public function deleteInstallation(string $installationId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all API keys from the current organization. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\KeyList */ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite\Models\KeyList { @@ -371,18 +334,12 @@ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite } return \Appwrite\Models\KeyList::from($response); - } /** * Create a new organization API key. * - * @param string $keyId - * @param string $name - * @param array $scopes - * @param ?string $expire * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function createKey(string $keyId, string $name, array $scopes, ?string $expire = null): \Appwrite\Models\Key { @@ -415,16 +372,13 @@ public function createKey(string $keyId, string $name, array $scopes, ?string $e } return \Appwrite\Models\Key::from($response); - } /** * Get a key by its unique ID. This endpoint returns details about a specific * API key in your organization including its scopes. * - * @param string $keyId * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function getKey(string $keyId): \Appwrite\Models\Key { @@ -453,19 +407,13 @@ public function getKey(string $keyId): \Appwrite\Models\Key } return \Appwrite\Models\Key::from($response); - } /** * Update a key by its unique ID. Use this endpoint to update the name, * scopes, or expiration time of an API key. * - * @param string $keyId - * @param string $name - * @param array $scopes - * @param ?string $expire * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function updateKey(string $keyId, string $name, array $scopes, ?string $expire = null): \Appwrite\Models\Key { @@ -498,16 +446,13 @@ public function updateKey(string $keyId, string $name, array $scopes, ?string $e } return \Appwrite\Models\Key::from($response); - } /** * Delete a key by its unique ID. Once deleted, the key can no longer be used * to authenticate API calls. * - * @param string $keyId * @throws AppwriteException - * @return string */ public function deleteKey(string $keyId): string { @@ -524,25 +469,18 @@ public function deleteKey(string $keyId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all memberships from the current organization. * - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\MembershipList */ public function listMemberships(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\MembershipList { @@ -582,7 +520,6 @@ public function listMemberships(?array $queries = null, ?string $search = null, } return \Appwrite\Models\MembershipList::from($response); - } /** @@ -590,14 +527,7 @@ public function listMemberships(?array $queries = null, ?string $search = null, * to join the organization will be sent to the new member's email address. If * member doesn't exist in the project it will be automatically created. * - * @param array $roles - * @param ?string $email - * @param ?string $userId - * @param ?string $phone - * @param ?string $url - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function createMembership(array $roles, ?string $email = null, ?string $userId = null, ?string $phone = null, ?string $url = null, ?string $name = null): \Appwrite\Models\Membership { @@ -647,15 +577,12 @@ public function createMembership(array $roles, ?string $email = null, ?string $u } return \Appwrite\Models\Membership::from($response); - } /** * Get a membership from the current organization by its unique ID. * - * @param string $membershipId * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function getMembership(string $membershipId): \Appwrite\Models\Membership { @@ -684,16 +611,12 @@ public function getMembership(string $membershipId): \Appwrite\Models\Membership } return \Appwrite\Models\Membership::from($response); - } /** * Modify the roles of a member in the current organization. * - * @param string $membershipId - * @param array $roles * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function updateMembership(string $membershipId, array $roles): \Appwrite\Models\Membership { @@ -724,7 +647,6 @@ public function updateMembership(string $membershipId, array $roles): \Appwrite\ } return \Appwrite\Models\Membership::from($response); - } /** @@ -732,9 +654,7 @@ public function updateMembership(string $membershipId, array $roles): \Appwrite\ * whether they accepted the invitation or not; a pending invitation is * revoked. * - * @param string $membershipId * @throws AppwriteException - * @return string */ public function deleteMembership(string $membershipId): string { @@ -751,26 +671,19 @@ public function deleteMembership(string $membershipId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all projects. You can use the query params to filter your * results. * - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ProjectList */ public function listProjects(?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\ProjectList { @@ -810,17 +723,12 @@ public function listProjects(?array $queries = null, ?string $search = null, ?bo } return \Appwrite\Models\ProjectList::from($response); - } /** * Create a new project. * - * @param string $projectId - * @param string $name - * @param ?Region $region * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function createProject(string $projectId, string $name, ?Region $region = null): \Appwrite\Models\Project { @@ -855,15 +763,12 @@ public function createProject(string $projectId, string $name, ?Region $region = } return \Appwrite\Models\Project::from($response); - } /** * Get a project. * - * @param string $projectId * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function getProject(string $projectId): \Appwrite\Models\Project { @@ -891,16 +796,12 @@ public function getProject(string $projectId): \Appwrite\Models\Project } return \Appwrite\Models\Project::from($response); - } /** * Update a project by its unique ID. * - * @param string $projectId - * @param string $name * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateProject(string $projectId, string $name): \Appwrite\Models\Project { @@ -931,15 +832,12 @@ public function updateProject(string $projectId, string $name): \Appwrite\Models } return \Appwrite\Models\Project::from($response); - } /** * Delete a project by its unique ID. * - * @param string $projectId * @throws AppwriteException - * @return string */ public function deleteProject(string $projectId): string { @@ -956,14 +854,11 @@ public function deleteProject(string $projectId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Presences.php b/src/Appwrite/Services/Presences.php index f4f09e42..80f429c9 100644 --- a/src/Appwrite/Services/Presences.php +++ b/src/Appwrite/Services/Presences.php @@ -1,28 +1,19 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Project.php b/src/Appwrite/Services/Project.php index e398c92e..04a2c152 100644 --- a/src/Appwrite/Services/Project.php +++ b/src/Appwrite/Services/Project.php @@ -1,15 +1,13 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update properties of a specific auth method. Use this endpoint to enable or - * disable a method in your project. + * disable a method in your project. * - * @param ProjectAuthMethodId $methodId - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateAuthMethod(ProjectAuthMethodId $methodId, bool $enabled): \Appwrite\Models\Project { $apiPath = str_replace( ['{methodId}'], - [$methodId], + [(string) $methodId], '/project/auth-methods/{methodId}' ); @@ -128,16 +112,12 @@ public function updateAuthMethod(ProjectAuthMethodId $methodId, bool $enabled): } return \Appwrite\Models\Project::from($response); - } /** * Get a list of all API keys from the current project. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\KeyList */ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite\Models\KeyList { @@ -173,20 +153,16 @@ public function listKeys(?array $queries = null, ?bool $total = null): \Appwrite } return \Appwrite\Models\KeyList::from($response); - } /** * Create a new ephemeral API key. It's recommended to have multiple API keys * with strict scopes for separate functions within your project. - * + * * You can also create a standard API key if you need a longer-lived key * instead. * - * @param array $scopes - * @param int $duration * @throws AppwriteException - * @return \Appwrite\Models\EphemeralKey */ public function createEphemeralKey(array $scopes, int $duration): \Appwrite\Models\EphemeralKey { @@ -217,15 +193,12 @@ public function createEphemeralKey(array $scopes, int $duration): \Appwrite\Mode } return \Appwrite\Models\EphemeralKey::from($response); - } /** - * Get a key by its unique ID. + * Get a key by its unique ID. * - * @param string $keyId * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function getKey(string $keyId): \Appwrite\Models\Key { @@ -254,19 +227,13 @@ public function getKey(string $keyId): \Appwrite\Models\Key } return \Appwrite\Models\Key::from($response); - } /** * Update a key by its unique ID. Use this endpoint to update the name, * scopes, or expiration time of an API key. * - * @param string $keyId - * @param string $name - * @param array $scopes - * @param ?string $expire * @throws AppwriteException - * @return \Appwrite\Models\Key */ public function updateKey(string $keyId, string $name, array $scopes, ?string $expire = null): \Appwrite\Models\Key { @@ -299,16 +266,13 @@ public function updateKey(string $keyId, string $name, array $scopes, ?string $e } return \Appwrite\Models\Key::from($response); - } /** * Delete a key by its unique ID. Once deleted, the key can no longer be used * to authenticate API calls. * - * @param string $keyId * @throws AppwriteException - * @return string */ public function deleteKey(string $keyId): string { @@ -325,24 +289,19 @@ public function deleteKey(string $keyId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the project labels. Labels can be used to easily filter projects in * an organization. * - * @param array $labels * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateLabels(array $labels): \Appwrite\Models\Project { @@ -372,17 +331,13 @@ public function updateLabels(array $labels): \Appwrite\Models\Project } return \Appwrite\Models\Project::from($response); - } /** * Get a list of all mock phones in the project. This endpoint returns an * array of all mock phones and their OTPs. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\MockNumberList */ public function listMockPhones(?array $queries = null, ?bool $total = null): \Appwrite\Models\MockNumberList { @@ -418,17 +373,13 @@ public function listMockPhones(?array $queries = null, ?bool $total = null): \Ap } return \Appwrite\Models\MockNumberList::from($response); - } /** * Create a new mock phone for your project. Use this endpoint to register a * mock phone number and its sign-in OTP for your testers. * - * @param string $number - * @param string $otp * @throws AppwriteException - * @return \Appwrite\Models\MockNumber */ public function createMockPhone(string $number, string $otp): \Appwrite\Models\MockNumber { @@ -459,16 +410,13 @@ public function createMockPhone(string $number, string $otp): \Appwrite\Models\M } return \Appwrite\Models\MockNumber::from($response); - } /** * Get a mock phone by its unique number. This endpoint returns the mock * phone's OTP. * - * @param string $number * @throws AppwriteException - * @return \Appwrite\Models\MockNumber */ public function getMockPhone(string $number): \Appwrite\Models\MockNumber { @@ -497,17 +445,13 @@ public function getMockPhone(string $number): \Appwrite\Models\MockNumber } return \Appwrite\Models\MockNumber::from($response); - } /** * Update a mock phone by its unique number. Use this endpoint to update the * mock phone's OTP. * - * @param string $number - * @param string $otp * @throws AppwriteException - * @return \Appwrite\Models\MockNumber */ public function updateMockPhone(string $number, string $otp): \Appwrite\Models\MockNumber { @@ -538,16 +482,13 @@ public function updateMockPhone(string $number, string $otp): \Appwrite\Models\M } return \Appwrite\Models\MockNumber::from($response); - } /** * Delete a mock phone by its unique number. This endpoint removes the mock * phone and its OTP configuration from the project. * - * @param string $number * @throws AppwriteException - * @return string */ public function deleteMockPhone(string $number): string { @@ -564,15 +505,12 @@ public function deleteMockPhone(string $number): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -580,10 +518,7 @@ public function deleteMockPhone(string $number): string * project's configuration for each. Credential fields are write-only and * always returned empty. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\OAuth2ProviderList */ public function listOAuth2Providers(?array $queries = null, ?bool $total = null): \Appwrite\Models\OAuth2ProviderList { @@ -619,30 +554,12 @@ public function listOAuth2Providers(?array $queries = null, ?bool $total = null) } return \Appwrite\Models\OAuth2ProviderList::from($response); - } /** * Update the OAuth2 server (OIDC provider) configuration. * - * @param bool $enabled - * @param string $authorizationUrl - * @param ?array $scopes - * @param ?array $authorizationDetailsTypes - * @param ?int $accessTokenDuration - * @param ?int $refreshTokenDuration - * @param ?int $publicAccessTokenDuration - * @param ?int $publicRefreshTokenDuration - * @param ?int $installationAccessTokenDuration - * @param ?bool $confidentialPkce - * @param ?string $verificationUrl - * @param ?int $userCodeLength - * @param ?string $userCodeFormat - * @param ?int $deviceCodeDuration - * @param ?array $defaultScopes - * @param ?array $installationScopes * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?array $scopes = null, ?array $authorizationDetailsTypes = null, ?int $accessTokenDuration = null, ?int $refreshTokenDuration = null, ?int $publicAccessTokenDuration = null, ?int $publicRefreshTokenDuration = null, ?int $installationAccessTokenDuration = null, ?bool $confidentialPkce = null, ?string $verificationUrl = null, ?int $userCodeLength = null, ?string $userCodeFormat = null, ?int $deviceCodeDuration = null, ?array $defaultScopes = null, ?array $installationScopes = null): \Appwrite\Models\Project { @@ -705,17 +622,12 @@ public function updateOAuth2Server(bool $enabled, string $authorizationUrl, ?arr } return \Appwrite\Models\Project::from($response); - } /** * Update the project OAuth2 Amazon configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Amazon */ public function updateOAuth2Amazon(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Amazon { @@ -747,19 +659,12 @@ public function updateOAuth2Amazon(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Amazon::from($response); - } /** * Update the project OAuth2 Apple configuration. * - * @param ?string $serviceId - * @param ?string $keyId - * @param ?string $teamId - * @param ?string $p8File - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Apple */ public function updateOAuth2Apple(?string $serviceId = null, ?string $keyId = null, ?string $teamId = null, ?string $p8File = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Apple { @@ -793,17 +698,12 @@ public function updateOAuth2Apple(?string $serviceId = null, ?string $keyId = nu } return \Appwrite\Models\OAuth2Apple::from($response); - } /** * Update the project OAuth2 Appwrite configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Appwrite */ public function updateOAuth2Appwrite(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Appwrite { @@ -835,18 +735,12 @@ public function updateOAuth2Appwrite(?string $clientId = null, ?string $clientSe } return \Appwrite\Models\OAuth2Appwrite::from($response); - } /** * Update the project OAuth2 Auth0 configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $endpoint - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Auth0 */ public function updateOAuth2Auth0(?string $clientId = null, ?string $clientSecret = null, ?string $endpoint = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Auth0 { @@ -879,18 +773,12 @@ public function updateOAuth2Auth0(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Auth0::from($response); - } /** * Update the project OAuth2 Authentik configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $endpoint - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Authentik */ public function updateOAuth2Authentik(?string $clientId = null, ?string $clientSecret = null, ?string $endpoint = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Authentik { @@ -923,17 +811,12 @@ public function updateOAuth2Authentik(?string $clientId = null, ?string $clientS } return \Appwrite\Models\OAuth2Authentik::from($response); - } /** * Update the project OAuth2 Autodesk configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Autodesk */ public function updateOAuth2Autodesk(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Autodesk { @@ -965,17 +848,12 @@ public function updateOAuth2Autodesk(?string $clientId = null, ?string $clientSe } return \Appwrite\Models\OAuth2Autodesk::from($response); - } /** * Update the project OAuth2 Bitbucket configuration. * - * @param ?string $key - * @param ?string $secret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Bitbucket */ public function updateOAuth2Bitbucket(?string $key = null, ?string $secret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Bitbucket { @@ -1007,17 +885,12 @@ public function updateOAuth2Bitbucket(?string $key = null, ?string $secret = nul } return \Appwrite\Models\OAuth2Bitbucket::from($response); - } /** * Update the project OAuth2 Bitly configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Bitly */ public function updateOAuth2Bitly(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Bitly { @@ -1049,17 +922,12 @@ public function updateOAuth2Bitly(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Bitly::from($response); - } /** * Update the project OAuth2 Box configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Box */ public function updateOAuth2Box(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Box { @@ -1091,17 +959,12 @@ public function updateOAuth2Box(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Box::from($response); - } /** * Update the project OAuth2 Dailymotion configuration. * - * @param ?string $apiKey - * @param ?string $apiSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Dailymotion */ public function updateOAuth2Dailymotion(?string $apiKey = null, ?string $apiSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Dailymotion { @@ -1133,17 +996,12 @@ public function updateOAuth2Dailymotion(?string $apiKey = null, ?string $apiSecr } return \Appwrite\Models\OAuth2Dailymotion::from($response); - } /** * Update the project OAuth2 Discord configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Discord */ public function updateOAuth2Discord(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Discord { @@ -1175,17 +1033,12 @@ public function updateOAuth2Discord(?string $clientId = null, ?string $clientSec } return \Appwrite\Models\OAuth2Discord::from($response); - } /** * Update the project OAuth2 Disqus configuration. * - * @param ?string $publicKey - * @param ?string $secretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Disqus */ public function updateOAuth2Disqus(?string $publicKey = null, ?string $secretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Disqus { @@ -1217,17 +1070,12 @@ public function updateOAuth2Disqus(?string $publicKey = null, ?string $secretKey } return \Appwrite\Models\OAuth2Disqus::from($response); - } /** * Update the project OAuth2 Dropbox configuration. * - * @param ?string $appKey - * @param ?string $appSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Dropbox */ public function updateOAuth2Dropbox(?string $appKey = null, ?string $appSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Dropbox { @@ -1259,17 +1107,12 @@ public function updateOAuth2Dropbox(?string $appKey = null, ?string $appSecret = } return \Appwrite\Models\OAuth2Dropbox::from($response); - } /** * Update the project OAuth2 Etsy configuration. * - * @param ?string $keyString - * @param ?string $sharedSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Etsy */ public function updateOAuth2Etsy(?string $keyString = null, ?string $sharedSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Etsy { @@ -1301,17 +1144,12 @@ public function updateOAuth2Etsy(?string $keyString = null, ?string $sharedSecre } return \Appwrite\Models\OAuth2Etsy::from($response); - } /** * Update the project OAuth2 Facebook configuration. * - * @param ?string $appId - * @param ?string $appSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Facebook */ public function updateOAuth2Facebook(?string $appId = null, ?string $appSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Facebook { @@ -1343,17 +1181,12 @@ public function updateOAuth2Facebook(?string $appId = null, ?string $appSecret = } return \Appwrite\Models\OAuth2Facebook::from($response); - } /** * Update the project OAuth2 Figma configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Figma */ public function updateOAuth2Figma(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Figma { @@ -1385,18 +1218,12 @@ public function updateOAuth2Figma(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Figma::from($response); - } /** * Update the project OAuth2 FusionAuth configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $endpoint - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2FusionAuth */ public function updateOAuth2FusionAuth(?string $clientId = null, ?string $clientSecret = null, ?string $endpoint = null, ?bool $enabled = null): \Appwrite\Models\OAuth2FusionAuth { @@ -1429,17 +1256,12 @@ public function updateOAuth2FusionAuth(?string $clientId = null, ?string $client } return \Appwrite\Models\OAuth2FusionAuth::from($response); - } /** * Update the project OAuth2 GitHub configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Github */ public function updateOAuth2GitHub(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Github { @@ -1471,18 +1293,12 @@ public function updateOAuth2GitHub(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Github::from($response); - } /** * Update the project OAuth2 Gitlab configuration. * - * @param ?string $applicationId - * @param ?string $secret - * @param ?string $endpoint - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Gitlab */ public function updateOAuth2Gitlab(?string $applicationId = null, ?string $secret = null, ?string $endpoint = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Gitlab { @@ -1515,18 +1331,12 @@ public function updateOAuth2Gitlab(?string $applicationId = null, ?string $secre } return \Appwrite\Models\OAuth2Gitlab::from($response); - } /** * Update the project OAuth2 Google configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?array $prompt - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Google */ public function updateOAuth2Google(?string $clientId = null, ?string $clientSecret = null, ?array $prompt = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Google { @@ -1559,19 +1369,49 @@ public function updateOAuth2Google(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Google::from($response); + } + + /** + * Update the project OAuth2 Hugging Face configuration. + * + * @throws AppwriteException + */ + public function updateOAuth2HuggingFace(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2HuggingFace + { + $apiPath = str_replace( + [], + [], + '/project/oauth2/huggingface' + ); + + $apiParams = []; + $apiParams['clientId'] = $clientId; + $apiParams['clientSecret'] = $clientSecret; + $apiParams['enabled'] = $enabled; + + $apiHeaders = []; + $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); + $apiHeaders['content-type'] = 'application/json'; + $apiHeaders['accept'] = 'application/json'; + $response = $this->client->call( + Client::METHOD_PATCH, + $apiPath, + $apiHeaders, + $apiParams + ); + + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\OAuth2HuggingFace::from($response); } /** * Update the project OAuth2 Keycloak configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $endpoint - * @param ?string $realmName - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Keycloak */ public function updateOAuth2Keycloak(?string $clientId = null, ?string $clientSecret = null, ?string $endpoint = null, ?string $realmName = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Keycloak { @@ -1605,17 +1445,12 @@ public function updateOAuth2Keycloak(?string $clientId = null, ?string $clientSe } return \Appwrite\Models\OAuth2Keycloak::from($response); - } /** * Update the project OAuth2 Kick configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Kick */ public function updateOAuth2Kick(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Kick { @@ -1647,17 +1482,12 @@ public function updateOAuth2Kick(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Kick::from($response); - } /** * Update the project OAuth2 Linkedin configuration. * - * @param ?string $clientId - * @param ?string $primaryClientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Linkedin */ public function updateOAuth2Linkedin(?string $clientId = null, ?string $primaryClientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Linkedin { @@ -1689,18 +1519,12 @@ public function updateOAuth2Linkedin(?string $clientId = null, ?string $primaryC } return \Appwrite\Models\OAuth2Linkedin::from($response); - } /** * Update the project OAuth2 Microsoft configuration. * - * @param ?string $applicationId - * @param ?string $applicationSecret - * @param ?string $tenant - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Microsoft */ public function updateOAuth2Microsoft(?string $applicationId = null, ?string $applicationSecret = null, ?string $tenant = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Microsoft { @@ -1733,17 +1557,12 @@ public function updateOAuth2Microsoft(?string $applicationId = null, ?string $ap } return \Appwrite\Models\OAuth2Microsoft::from($response); - } /** * Update the project OAuth2 Notion configuration. * - * @param ?string $oauthClientId - * @param ?string $oauthClientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Notion */ public function updateOAuth2Notion(?string $oauthClientId = null, ?string $oauthClientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Notion { @@ -1775,23 +1594,12 @@ public function updateOAuth2Notion(?string $oauthClientId = null, ?string $oauth } return \Appwrite\Models\OAuth2Notion::from($response); - } /** * Update the project OAuth2 Oidc configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $wellKnownURL - * @param ?string $authorizationURL - * @param ?string $tokenURL - * @param ?string $userInfoURL - * @param ?array $prompt - * @param ?int $maxAge - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Oidc */ public function updateOAuth2Oidc(?string $clientId = null, ?string $clientSecret = null, ?string $wellKnownURL = null, ?string $authorizationURL = null, ?string $tokenURL = null, ?string $userInfoURL = null, ?array $prompt = null, ?int $maxAge = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Oidc { @@ -1829,19 +1637,12 @@ public function updateOAuth2Oidc(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Oidc::from($response); - } /** * Update the project OAuth2 Okta configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?string $domain - * @param ?string $authorizationServerId - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Okta */ public function updateOAuth2Okta(?string $clientId = null, ?string $clientSecret = null, ?string $domain = null, ?string $authorizationServerId = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Okta { @@ -1875,17 +1676,12 @@ public function updateOAuth2Okta(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Okta::from($response); - } /** * Update the project OAuth2 Paypal configuration. * - * @param ?string $clientId - * @param ?string $secretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Paypal */ public function updateOAuth2Paypal(?string $clientId = null, ?string $secretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Paypal { @@ -1917,17 +1713,12 @@ public function updateOAuth2Paypal(?string $clientId = null, ?string $secretKey } return \Appwrite\Models\OAuth2Paypal::from($response); - } /** * Update the project OAuth2 PaypalSandbox configuration. * - * @param ?string $clientId - * @param ?string $secretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Paypal */ public function updateOAuth2PaypalSandbox(?string $clientId = null, ?string $secretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Paypal { @@ -1959,17 +1750,12 @@ public function updateOAuth2PaypalSandbox(?string $clientId = null, ?string $sec } return \Appwrite\Models\OAuth2Paypal::from($response); - } /** * Update the project OAuth2 Podio configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Podio */ public function updateOAuth2Podio(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Podio { @@ -2001,17 +1787,12 @@ public function updateOAuth2Podio(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Podio::from($response); - } /** * Update the project OAuth2 Salesforce configuration. * - * @param ?string $customerKey - * @param ?string $customerSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Salesforce */ public function updateOAuth2Salesforce(?string $customerKey = null, ?string $customerSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Salesforce { @@ -2043,17 +1824,12 @@ public function updateOAuth2Salesforce(?string $customerKey = null, ?string $cus } return \Appwrite\Models\OAuth2Salesforce::from($response); - } /** * Update the project OAuth2 Slack configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Slack */ public function updateOAuth2Slack(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Slack { @@ -2085,17 +1861,12 @@ public function updateOAuth2Slack(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Slack::from($response); - } /** * Update the project OAuth2 Spotify configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Spotify */ public function updateOAuth2Spotify(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Spotify { @@ -2127,17 +1898,12 @@ public function updateOAuth2Spotify(?string $clientId = null, ?string $clientSec } return \Appwrite\Models\OAuth2Spotify::from($response); - } /** * Update the project OAuth2 Stripe configuration. * - * @param ?string $clientId - * @param ?string $apiSecretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Stripe */ public function updateOAuth2Stripe(?string $clientId = null, ?string $apiSecretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Stripe { @@ -2169,17 +1935,12 @@ public function updateOAuth2Stripe(?string $clientId = null, ?string $apiSecretK } return \Appwrite\Models\OAuth2Stripe::from($response); - } /** * Update the project OAuth2 Tradeshift configuration. * - * @param ?string $oauth2ClientId - * @param ?string $oauth2ClientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Tradeshift */ public function updateOAuth2Tradeshift(?string $oauth2ClientId = null, ?string $oauth2ClientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Tradeshift { @@ -2211,17 +1972,12 @@ public function updateOAuth2Tradeshift(?string $oauth2ClientId = null, ?string $ } return \Appwrite\Models\OAuth2Tradeshift::from($response); - } /** * Update the project OAuth2 Tradeshift Sandbox configuration. * - * @param ?string $oauth2ClientId - * @param ?string $oauth2ClientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Tradeshift */ public function updateOAuth2TradeshiftSandbox(?string $oauth2ClientId = null, ?string $oauth2ClientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Tradeshift { @@ -2253,17 +2009,12 @@ public function updateOAuth2TradeshiftSandbox(?string $oauth2ClientId = null, ?s } return \Appwrite\Models\OAuth2Tradeshift::from($response); - } /** * Update the project OAuth2 Twitch configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Twitch */ public function updateOAuth2Twitch(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Twitch { @@ -2295,17 +2046,12 @@ public function updateOAuth2Twitch(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Twitch::from($response); - } /** * Update the project OAuth2 WordPress configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2WordPress */ public function updateOAuth2WordPress(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2WordPress { @@ -2337,17 +2083,12 @@ public function updateOAuth2WordPress(?string $clientId = null, ?string $clientS } return \Appwrite\Models\OAuth2WordPress::from($response); - } /** * Update the project OAuth2 X configuration. * - * @param ?string $customerKey - * @param ?string $secretKey - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2X */ public function updateOAuth2X(?string $customerKey = null, ?string $secretKey = null, ?bool $enabled = null): \Appwrite\Models\OAuth2X { @@ -2379,17 +2120,12 @@ public function updateOAuth2X(?string $customerKey = null, ?string $secretKey = } return \Appwrite\Models\OAuth2X::from($response); - } /** * Update the project OAuth2 Yahoo configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Yahoo */ public function updateOAuth2Yahoo(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Yahoo { @@ -2421,17 +2157,12 @@ public function updateOAuth2Yahoo(?string $clientId = null, ?string $clientSecre } return \Appwrite\Models\OAuth2Yahoo::from($response); - } /** * Update the project OAuth2 Yandex configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Yandex */ public function updateOAuth2Yandex(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Yandex { @@ -2463,17 +2194,12 @@ public function updateOAuth2Yandex(?string $clientId = null, ?string $clientSecr } return \Appwrite\Models\OAuth2Yandex::from($response); - } /** * Update the project OAuth2 Zoho configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Zoho */ public function updateOAuth2Zoho(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Zoho { @@ -2505,17 +2231,12 @@ public function updateOAuth2Zoho(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Zoho::from($response); - } /** * Update the project OAuth2 Zoom configuration. * - * @param ?string $clientId - * @param ?string $clientSecret - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Zoom */ public function updateOAuth2Zoom(?string $clientId = null, ?string $clientSecret = null, ?bool $enabled = null): \Appwrite\Models\OAuth2Zoom { @@ -2547,22 +2268,19 @@ public function updateOAuth2Zoom(?string $clientId = null, ?string $clientSecret } return \Appwrite\Models\OAuth2Zoom::from($response); - } /** * Get a single OAuth2 provider configuration. Credential fields (client * secret, p8 file, key/team IDs) are write-only and always returned empty. * - * @param ProjectOAuthProviderId $providerId * @throws AppwriteException - * @return \Appwrite\Models\OAuth2Github|\Appwrite\Models\OAuth2Discord|\Appwrite\Models\OAuth2Figma|\Appwrite\Models\OAuth2Dropbox|\Appwrite\Models\OAuth2Dailymotion|\Appwrite\Models\OAuth2Bitbucket|\Appwrite\Models\OAuth2Bitly|\Appwrite\Models\OAuth2Box|\Appwrite\Models\OAuth2Autodesk|\Appwrite\Models\OAuth2Google|\Appwrite\Models\OAuth2Zoom|\Appwrite\Models\OAuth2Zoho|\Appwrite\Models\OAuth2Yandex|\Appwrite\Models\OAuth2X|\Appwrite\Models\OAuth2WordPress|\Appwrite\Models\OAuth2Twitch|\Appwrite\Models\OAuth2Stripe|\Appwrite\Models\OAuth2Spotify|\Appwrite\Models\OAuth2Slack|\Appwrite\Models\OAuth2Podio|\Appwrite\Models\OAuth2Notion|\Appwrite\Models\OAuth2Salesforce|\Appwrite\Models\OAuth2Yahoo|\Appwrite\Models\OAuth2Linkedin|\Appwrite\Models\OAuth2Disqus|\Appwrite\Models\OAuth2Amazon|\Appwrite\Models\OAuth2Etsy|\Appwrite\Models\OAuth2Facebook|\Appwrite\Models\OAuth2Tradeshift|\Appwrite\Models\OAuth2Paypal|\Appwrite\Models\OAuth2Gitlab|\Appwrite\Models\OAuth2Authentik|\Appwrite\Models\OAuth2Auth0|\Appwrite\Models\OAuth2FusionAuth|\Appwrite\Models\OAuth2Keycloak|\Appwrite\Models\OAuth2Oidc|\Appwrite\Models\OAuth2Apple|\Appwrite\Models\OAuth2Okta|\Appwrite\Models\OAuth2Kick|\Appwrite\Models\OAuth2Microsoft */ - public function getOAuth2Provider(ProjectOAuthProviderId $providerId): \Appwrite\Models\OAuth2Github|\Appwrite\Models\OAuth2Discord|\Appwrite\Models\OAuth2Figma|\Appwrite\Models\OAuth2Dropbox|\Appwrite\Models\OAuth2Dailymotion|\Appwrite\Models\OAuth2Bitbucket|\Appwrite\Models\OAuth2Bitly|\Appwrite\Models\OAuth2Box|\Appwrite\Models\OAuth2Autodesk|\Appwrite\Models\OAuth2Google|\Appwrite\Models\OAuth2Zoom|\Appwrite\Models\OAuth2Zoho|\Appwrite\Models\OAuth2Yandex|\Appwrite\Models\OAuth2X|\Appwrite\Models\OAuth2WordPress|\Appwrite\Models\OAuth2Twitch|\Appwrite\Models\OAuth2Stripe|\Appwrite\Models\OAuth2Spotify|\Appwrite\Models\OAuth2Slack|\Appwrite\Models\OAuth2Podio|\Appwrite\Models\OAuth2Notion|\Appwrite\Models\OAuth2Salesforce|\Appwrite\Models\OAuth2Yahoo|\Appwrite\Models\OAuth2Linkedin|\Appwrite\Models\OAuth2Disqus|\Appwrite\Models\OAuth2Amazon|\Appwrite\Models\OAuth2Etsy|\Appwrite\Models\OAuth2Facebook|\Appwrite\Models\OAuth2Tradeshift|\Appwrite\Models\OAuth2Paypal|\Appwrite\Models\OAuth2Gitlab|\Appwrite\Models\OAuth2Authentik|\Appwrite\Models\OAuth2Auth0|\Appwrite\Models\OAuth2FusionAuth|\Appwrite\Models\OAuth2Keycloak|\Appwrite\Models\OAuth2Oidc|\Appwrite\Models\OAuth2Apple|\Appwrite\Models\OAuth2Okta|\Appwrite\Models\OAuth2Kick|\Appwrite\Models\OAuth2Microsoft + public function getOAuth2Provider(ProjectOAuthProviderId $providerId): \Appwrite\Models\OAuth2Github|\Appwrite\Models\OAuth2Discord|\Appwrite\Models\OAuth2Figma|\Appwrite\Models\OAuth2Dropbox|\Appwrite\Models\OAuth2Dailymotion|\Appwrite\Models\OAuth2Bitbucket|\Appwrite\Models\OAuth2Bitly|\Appwrite\Models\OAuth2Box|\Appwrite\Models\OAuth2Autodesk|\Appwrite\Models\OAuth2Google|\Appwrite\Models\OAuth2Zoom|\Appwrite\Models\OAuth2Zoho|\Appwrite\Models\OAuth2Yandex|\Appwrite\Models\OAuth2X|\Appwrite\Models\OAuth2WordPress|\Appwrite\Models\OAuth2Twitch|\Appwrite\Models\OAuth2Stripe|\Appwrite\Models\OAuth2Spotify|\Appwrite\Models\OAuth2Slack|\Appwrite\Models\OAuth2Podio|\Appwrite\Models\OAuth2Notion|\Appwrite\Models\OAuth2Salesforce|\Appwrite\Models\OAuth2Yahoo|\Appwrite\Models\OAuth2HuggingFace|\Appwrite\Models\OAuth2Linkedin|\Appwrite\Models\OAuth2Disqus|\Appwrite\Models\OAuth2Amazon|\Appwrite\Models\OAuth2Etsy|\Appwrite\Models\OAuth2Facebook|\Appwrite\Models\OAuth2Tradeshift|\Appwrite\Models\OAuth2Paypal|\Appwrite\Models\OAuth2Gitlab|\Appwrite\Models\OAuth2Authentik|\Appwrite\Models\OAuth2Auth0|\Appwrite\Models\OAuth2FusionAuth|\Appwrite\Models\OAuth2Keycloak|\Appwrite\Models\OAuth2Oidc|\Appwrite\Models\OAuth2Apple|\Appwrite\Models\OAuth2Okta|\Appwrite\Models\OAuth2Kick|\Appwrite\Models\OAuth2Microsoft { $apiPath = str_replace( ['{providerId}'], - [$providerId], + [(string) $providerId], '/project/oauth2/{providerId}' ); @@ -2676,6 +2394,10 @@ public function getOAuth2Provider(ProjectOAuthProviderId $providerId): \Appwrite return \Appwrite\Models\OAuth2Yahoo::from($response); } + if (($response['$id'] ?? null) === 'huggingface') { + return \Appwrite\Models\OAuth2HuggingFace::from($response); + } + if (($response['$id'] ?? null) === 'linkedin') { return \Appwrite\Models\OAuth2Linkedin::from($response); } @@ -2745,17 +2467,13 @@ public function getOAuth2Provider(ProjectOAuthProviderId $providerId): \Appwrite } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Get a list of all platforms in the project. This endpoint returns an array * of all platforms and their configurations. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\PlatformList */ public function listPlatforms(?array $queries = null, ?bool $total = null): \Appwrite\Models\PlatformList { @@ -2791,7 +2509,6 @@ public function listPlatforms(?array $queries = null, ?bool $total = null): \App } return \Appwrite\Models\PlatformList::from($response); - } /** @@ -2799,11 +2516,7 @@ public function listPlatforms(?array $queries = null, ?bool $total = null): \App * register a new Android platform where your users will run your application * which will interact with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $applicationId * @throws AppwriteException - * @return \Appwrite\Models\PlatformAndroid */ public function createAndroidPlatform(string $platformId, string $name, string $applicationId): \Appwrite\Models\PlatformAndroid { @@ -2835,18 +2548,13 @@ public function createAndroidPlatform(string $platformId, string $name, string $ } return \Appwrite\Models\PlatformAndroid::from($response); - } /** * Update an Android platform by its unique ID. Use this endpoint to update * the platform's name or application ID. * - * @param string $platformId - * @param string $name - * @param string $applicationId * @throws AppwriteException - * @return \Appwrite\Models\PlatformAndroid */ public function updateAndroidPlatform(string $platformId, string $name, string $applicationId): \Appwrite\Models\PlatformAndroid { @@ -2878,7 +2586,6 @@ public function updateAndroidPlatform(string $platformId, string $name, string $ } return \Appwrite\Models\PlatformAndroid::from($response); - } /** @@ -2886,11 +2593,7 @@ public function updateAndroidPlatform(string $platformId, string $name, string $ * a new Apple platform where your users will run your application which will * interact with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $bundleIdentifier * @throws AppwriteException - * @return \Appwrite\Models\PlatformApple */ public function createApplePlatform(string $platformId, string $name, string $bundleIdentifier): \Appwrite\Models\PlatformApple { @@ -2922,18 +2625,13 @@ public function createApplePlatform(string $platformId, string $name, string $bu } return \Appwrite\Models\PlatformApple::from($response); - } /** * Update an Apple platform by its unique ID. Use this endpoint to update the * platform's name or bundle identifier. * - * @param string $platformId - * @param string $name - * @param string $bundleIdentifier * @throws AppwriteException - * @return \Appwrite\Models\PlatformApple */ public function updateApplePlatform(string $platformId, string $name, string $bundleIdentifier): \Appwrite\Models\PlatformApple { @@ -2965,7 +2663,6 @@ public function updateApplePlatform(string $platformId, string $name, string $bu } return \Appwrite\Models\PlatformApple::from($response); - } /** @@ -2973,11 +2670,7 @@ public function updateApplePlatform(string $platformId, string $name, string $bu * a new Linux platform where your users will run your application which will * interact with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $packageName * @throws AppwriteException - * @return \Appwrite\Models\PlatformLinux */ public function createLinuxPlatform(string $platformId, string $name, string $packageName): \Appwrite\Models\PlatformLinux { @@ -3009,18 +2702,13 @@ public function createLinuxPlatform(string $platformId, string $name, string $pa } return \Appwrite\Models\PlatformLinux::from($response); - } /** * Update a Linux platform by its unique ID. Use this endpoint to update the * platform's name or package name. * - * @param string $platformId - * @param string $name - * @param string $packageName * @throws AppwriteException - * @return \Appwrite\Models\PlatformLinux */ public function updateLinuxPlatform(string $platformId, string $name, string $packageName): \Appwrite\Models\PlatformLinux { @@ -3052,7 +2740,6 @@ public function updateLinuxPlatform(string $platformId, string $name, string $pa } return \Appwrite\Models\PlatformLinux::from($response); - } /** @@ -3060,11 +2747,7 @@ public function updateLinuxPlatform(string $platformId, string $name, string $pa * new platform where your users will run your application which will interact * with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $hostname * @throws AppwriteException - * @return \Appwrite\Models\PlatformWeb */ public function createWebPlatform(string $platformId, string $name, string $hostname): \Appwrite\Models\PlatformWeb { @@ -3096,18 +2779,13 @@ public function createWebPlatform(string $platformId, string $name, string $host } return \Appwrite\Models\PlatformWeb::from($response); - } /** * Update a web platform by its unique ID. Use this endpoint to update the * platform's name or hostname. * - * @param string $platformId - * @param string $name - * @param string $hostname * @throws AppwriteException - * @return \Appwrite\Models\PlatformWeb */ public function updateWebPlatform(string $platformId, string $name, string $hostname): \Appwrite\Models\PlatformWeb { @@ -3139,7 +2817,6 @@ public function updateWebPlatform(string $platformId, string $name, string $host } return \Appwrite\Models\PlatformWeb::from($response); - } /** @@ -3147,11 +2824,7 @@ public function updateWebPlatform(string $platformId, string $name, string $host * register a new Windows platform where your users will run your application * which will interact with the Appwrite API. * - * @param string $platformId - * @param string $name - * @param string $packageIdentifierName * @throws AppwriteException - * @return \Appwrite\Models\PlatformWindows */ public function createWindowsPlatform(string $platformId, string $name, string $packageIdentifierName): \Appwrite\Models\PlatformWindows { @@ -3183,18 +2856,13 @@ public function createWindowsPlatform(string $platformId, string $name, string $ } return \Appwrite\Models\PlatformWindows::from($response); - } /** * Update a Windows platform by its unique ID. Use this endpoint to update the * platform's name or package identifier name. * - * @param string $platformId - * @param string $name - * @param string $packageIdentifierName * @throws AppwriteException - * @return \Appwrite\Models\PlatformWindows */ public function updateWindowsPlatform(string $platformId, string $name, string $packageIdentifierName): \Appwrite\Models\PlatformWindows { @@ -3226,16 +2894,13 @@ public function updateWindowsPlatform(string $platformId, string $name, string $ } return \Appwrite\Models\PlatformWindows::from($response); - } /** * Get a platform by its unique ID. This endpoint returns the platform's * details, including its name, type, and key configurations. * - * @param string $platformId * @throws AppwriteException - * @return \Appwrite\Models\PlatformWeb|\Appwrite\Models\PlatformApple|\Appwrite\Models\PlatformAndroid|\Appwrite\Models\PlatformWindows|\Appwrite\Models\PlatformLinux */ public function getPlatform(string $platformId): \Appwrite\Models\PlatformWeb|\Appwrite\Models\PlatformApple|\Appwrite\Models\PlatformAndroid|\Appwrite\Models\PlatformWindows|\Appwrite\Models\PlatformLinux { @@ -3284,16 +2949,13 @@ public function getPlatform(string $platformId): \Appwrite\Models\PlatformWeb|\A } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Delete a platform by its unique ID. This endpoint removes the platform and * all its configurations from the project. * - * @param string $platformId * @throws AppwriteException - * @return string */ public function deletePlatform(string $platformId): string { @@ -3310,24 +2972,18 @@ public function deletePlatform(string $platformId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all project policies and their current configuration. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\PolicyList */ public function listPolicies(?array $queries = null, ?bool $total = null): \Appwrite\Models\PolicyList { @@ -3363,16 +3019,13 @@ public function listPolicies(?array $queries = null, ?bool $total = null): \Appw } return \Appwrite\Models\PolicyList::from($response); - } /** * Configures if aliased emails such as subaddresses and emails with suffixes * are denied during new users sign-ups and email updates. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateDenyAliasedEmailPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3402,16 +3055,13 @@ public function updateDenyAliasedEmailPolicy(bool $enabled): \Appwrite\Models\Pr } return \Appwrite\Models\Project::from($response); - } /** * Configures if only corporate email addresses (non-free and non-disposable * domains) are allowed during new user sign-ups and email updates. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateDenyCorporateEmailPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3441,16 +3091,13 @@ public function updateDenyCorporateEmailPolicy(bool $enabled): \Appwrite\Models\ } return \Appwrite\Models\Project::from($response); - } /** * Configures if disposable emails from known temporary domains are denied * during new users sign-ups and email updates. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateDenyDisposableEmailPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3480,16 +3127,13 @@ public function updateDenyDisposableEmailPolicy(bool $enabled): \Appwrite\Models } return \Appwrite\Models\Project::from($response); - } /** * Configures if emails from free providers such as Gmail or Yahoo are denied * during new users sign-ups and email updates. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateDenyFreeEmailPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3519,7 +3163,6 @@ public function updateDenyFreeEmailPolicy(bool $enabled): \Appwrite\Models\Proje } return \Appwrite\Models\Project::from($response); - } /** @@ -3527,14 +3170,7 @@ public function updateDenyFreeEmailPolicy(bool $enabled): \Appwrite\Models\Proje * members information. When enabled, all team members can see ID, name, * email, phone number, and MFA status of other members.. * - * @param ?bool $userId - * @param ?bool $userEmail - * @param ?bool $userPhone - * @param ?bool $userName - * @param ?bool $userMFA - * @param ?bool $userAccessedAt * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateMembershipPrivacyPolicy(?bool $userId = null, ?bool $userEmail = null, ?bool $userPhone = null, ?bool $userName = null, ?bool $userMFA = null, ?bool $userAccessedAt = null): \Appwrite\Models\Project { @@ -3587,7 +3223,6 @@ public function updateMembershipPrivacyPolicy(?bool $userId = null, ?bool $userE } return \Appwrite\Models\Project::from($response); - } /** @@ -3597,12 +3232,7 @@ public function updateMembershipPrivacyPolicy(?bool $userId = null, ?bool $userE * factor is disabled by default; enable it to deliver challenge codes through * your own channel. Recovery codes always remain available as a fallback. * - * @param ?bool $totp - * @param ?bool $email - * @param ?bool $phone - * @param ?bool $custom * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateMFAFactorsPolicy(?bool $totp = null, ?bool $email = null, ?bool $phone = null, ?bool $custom = null): \Appwrite\Models\Project { @@ -3647,7 +3277,6 @@ public function updateMFAFactorsPolicy(?bool $totp = null, ?bool $email = null, } return \Appwrite\Models\Project::from($response); - } /** @@ -3655,9 +3284,7 @@ public function updateMFAFactorsPolicy(?bool $totp = null, ?bool $email = null, * against most common passwords dictionary. When enabled, and user changes * their password, password must not be contained in the dictionary. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updatePasswordDictionaryPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3687,7 +3314,6 @@ public function updatePasswordDictionaryPolicy(bool $enabled): \Appwrite\Models\ } return \Appwrite\Models\Project::from($response); - } /** @@ -3695,15 +3321,13 @@ public function updatePasswordDictionaryPolicy(bool $enabled): \Appwrite\Models\ * configured, previous password hashes are stored, and users cannot choose a * new password that is already stored in the passwird history list, when * updating an user password, or setting new one through password recovery. - * + * * Keep in mind, while password history policy is disabled, the history is not * being stored. Enabling the policy will not have any history on existing * users, and it will only start to collect and enforce the policy on password * changes since the policy is enabled. * - * @param ?int $total * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updatePasswordHistoryPolicy(?int $total): \Appwrite\Models\Project { @@ -3733,7 +3357,6 @@ public function updatePasswordHistoryPolicy(?int $total): \Appwrite\Models\Proje } return \Appwrite\Models\Project::from($response); - } /** @@ -3742,9 +3365,7 @@ public function updatePasswordHistoryPolicy(?int $total): \Appwrite\Models\Proje * password, the password must not contain user ID, name, email or phone * number. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updatePasswordPersonalDataPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3774,19 +3395,12 @@ public function updatePasswordPersonalDataPolicy(bool $enabled): \Appwrite\Model } return \Appwrite\Models\Project::from($response); - } /** * Update the password strength requirements for users in the project. * - * @param ?int $min - * @param ?bool $uppercase - * @param ?bool $lowercase - * @param ?bool $number - * @param ?bool $symbols * @throws AppwriteException - * @return \Appwrite\Models\PolicyPasswordStrength */ public function updatePasswordStrengthPolicy(?int $min = null, ?bool $uppercase = null, ?bool $lowercase = null, ?bool $number = null, ?bool $symbols = null): \Appwrite\Models\PolicyPasswordStrength { @@ -3835,7 +3449,6 @@ public function updatePasswordStrengthPolicy(?int $min = null, ?bool $uppercase } return \Appwrite\Models\PolicyPasswordStrength::from($response); - } /** @@ -3845,9 +3458,7 @@ public function updatePasswordStrengthPolicy(?int $min = null, ?bool $uppercase * session after a new sign up does not trigger an alert, even if the policy * is enabled. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSessionAlertPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3877,16 +3488,13 @@ public function updateSessionAlertPolicy(bool $enabled): \Appwrite\Models\Projec } return \Appwrite\Models\Project::from($response); - } /** * Update maximum duration how long sessions created within a project should * stay active for. * - * @param int $duration * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSessionDurationPolicy(int $duration): \Appwrite\Models\Project { @@ -3916,7 +3524,6 @@ public function updateSessionDurationPolicy(int $duration): \Appwrite\Models\Pro } return \Appwrite\Models\Project::from($response); - } /** @@ -3924,9 +3531,7 @@ public function updateSessionDurationPolicy(int $duration): \Appwrite\Models\Pro * invalidated when a password of a user is changed. When enabled, and user * changes their password, they will be logged out of all their devices. * - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSessionInvalidationPolicy(bool $enabled): \Appwrite\Models\Project { @@ -3956,16 +3561,13 @@ public function updateSessionInvalidationPolicy(bool $enabled): \Appwrite\Models } return \Appwrite\Models\Project::from($response); - } /** * Update the maximum number of sessions allowed per user. When the limit is * hit, the oldest session will be deleted to make room for new one. * - * @param int $total * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSessionLimitPolicy(int $total): \Appwrite\Models\Project { @@ -3995,7 +3597,6 @@ public function updateSessionLimitPolicy(int $total): \Appwrite\Models\Project } return \Appwrite\Models\Project::from($response); - } /** @@ -4003,9 +3604,7 @@ public function updateSessionLimitPolicy(int $total): \Appwrite\Models\Project * amount of existing users already exceeded the limit, all users remain * active, but new user sign up will be prohibited. * - * @param ?int $total * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateUserLimitPolicy(?int $total): \Appwrite\Models\Project { @@ -4035,22 +3634,19 @@ public function updateUserLimitPolicy(?int $total): \Appwrite\Models\Project } return \Appwrite\Models\Project::from($response); - } /** * Get a policy by its unique ID. This endpoint returns the current * configuration for the requested project policy. * - * @param ProjectPolicyId $policyId * @throws AppwriteException - * @return \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordStrength|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy|\Appwrite\Models\PolicyMfaFactors|\Appwrite\Models\PolicyDenyAliasedEmail|\Appwrite\Models\PolicyDenyDisposableEmail|\Appwrite\Models\PolicyDenyFreeEmail|\Appwrite\Models\PolicyDenyCorporateEmail */ public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPasswordDictionary|\Appwrite\Models\PolicyPasswordHistory|\Appwrite\Models\PolicyPasswordStrength|\Appwrite\Models\PolicyPasswordPersonalData|\Appwrite\Models\PolicySessionAlert|\Appwrite\Models\PolicySessionDuration|\Appwrite\Models\PolicySessionInvalidation|\Appwrite\Models\PolicySessionLimit|\Appwrite\Models\PolicyUserLimit|\Appwrite\Models\PolicyMembershipPrivacy|\Appwrite\Models\PolicyMfaFactors|\Appwrite\Models\PolicyDenyAliasedEmail|\Appwrite\Models\PolicyDenyDisposableEmail|\Appwrite\Models\PolicyDenyFreeEmail|\Appwrite\Models\PolicyDenyCorporateEmail { $apiPath = str_replace( ['{policyId}'], - [$policyId], + [(string) $policyId], '/project/policies/{policyId}' ); @@ -4133,23 +3729,19 @@ public function getPolicy(ProjectPolicyId $policyId): \Appwrite\Models\PolicyPas } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Update properties of a specific protocol. Use this endpoint to enable or - * disable a protocol in your project. + * disable a protocol in your project. * - * @param ProjectProtocolId $protocolId - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateProtocol(ProjectProtocolId $protocolId, bool $enabled): \Appwrite\Models\Project { $apiPath = str_replace( ['{protocolId}'], - [$protocolId], + [(string) $protocolId], '/project/protocols/{protocolId}' ); @@ -4174,23 +3766,19 @@ public function updateProtocol(ProjectProtocolId $protocolId, bool $enabled): \A } return \Appwrite\Models\Project::from($response); - } /** * Update properties of a specific service. Use this endpoint to enable or - * disable a service in your project. + * disable a service in your project. * - * @param ProjectServiceId $serviceId - * @param bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateService(ProjectServiceId $serviceId, bool $enabled): \Appwrite\Models\Project { $apiPath = str_replace( ['{serviceId}'], - [$serviceId], + [(string) $serviceId], '/project/services/{serviceId}' ); @@ -4215,7 +3803,6 @@ public function updateService(ProjectServiceId $serviceId, bool $enabled): \Appw } return \Appwrite\Models\Project::from($response); - } /** @@ -4223,18 +3810,7 @@ public function updateService(ProjectServiceId $serviceId, bool $enabled): \Appw * configure your project's SMTP provider with your custom settings for * sending transactional emails. * - * @param ?string $host - * @param ?int $port - * @param ?string $username - * @param ?string $password - * @param ?string $senderEmail - * @param ?string $senderName - * @param ?string $replyToEmail - * @param ?string $replyToName - * @param ?ProjectSMTPSecure $secure - * @param ?bool $enabled * @throws AppwriteException - * @return \Appwrite\Models\Project */ public function updateSMTP(?string $host = null, ?int $port = null, ?string $username = null, ?string $password = null, ?string $senderEmail = null, ?string $senderName = null, ?string $replyToEmail = null, ?string $replyToName = null, ?ProjectSMTPSecure $secure = null, ?bool $enabled = null): \Appwrite\Models\Project { @@ -4273,15 +3849,12 @@ public function updateSMTP(?string $host = null, ?int $port = null, ?string $use } return \Appwrite\Models\Project::from($response); - } /** - * Send a test email to verify SMTP configuration. + * Send a test email to verify SMTP configuration. * - * @param array $emails * @throws AppwriteException - * @return string */ public function createSMTPTest(array $emails): string { @@ -4298,15 +3871,12 @@ public function createSMTPTest(array $emails): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -4314,10 +3884,7 @@ public function createSMTPTest(array $emails): string * endpoint returns an array of all configured email templates and their * locales. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\EmailTemplateList */ public function listEmailTemplates(?array $queries = null, ?bool $total = null): \Appwrite\Models\EmailTemplateList { @@ -4353,23 +3920,13 @@ public function listEmailTemplates(?array $queries = null, ?bool $total = null): } return \Appwrite\Models\EmailTemplateList::from($response); - } /** * Update a custom email template for the specified locale and type. Use this * endpoint to modify the content of your email templates. * - * @param ProjectEmailTemplateId $templateId - * @param ?ProjectEmailTemplateLocale $locale - * @param ?string $subject - * @param ?string $message - * @param ?string $senderName - * @param ?string $senderEmail - * @param ?string $replyToEmail - * @param ?string $replyToName * @throws AppwriteException - * @return \Appwrite\Models\EmailTemplate */ public function updateEmailTemplate(ProjectEmailTemplateId $templateId, ?ProjectEmailTemplateLocale $locale = null, ?string $subject = null, ?string $message = null, ?string $senderName = null, ?string $senderEmail = null, ?string $replyToEmail = null, ?string $replyToName = null): \Appwrite\Models\EmailTemplate { @@ -4409,7 +3966,6 @@ public function updateEmailTemplate(ProjectEmailTemplateId $templateId, ?Project } return \Appwrite\Models\EmailTemplate::from($response); - } /** @@ -4417,16 +3973,13 @@ public function updateEmailTemplate(ProjectEmailTemplateId $templateId, ?Project * endpoint returns the template content, subject, and other configuration * details. * - * @param ProjectEmailTemplateId $templateId - * @param ?ProjectEmailTemplateLocale $locale * @throws AppwriteException - * @return \Appwrite\Models\EmailTemplate */ public function getEmailTemplate(ProjectEmailTemplateId $templateId, ?ProjectEmailTemplateLocale $locale = null): \Appwrite\Models\EmailTemplate { $apiPath = str_replace( ['{templateId}'], - [$templateId], + [(string) $templateId], '/project/templates/email/{templateId}' ); @@ -4453,16 +4006,12 @@ public function getEmailTemplate(ProjectEmailTemplateId $templateId, ?ProjectEma } return \Appwrite\Models\EmailTemplate::from($response); - } /** * Get a list of all project environment variables. * - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\VariableList */ public function listVariables(?array $queries = null, ?bool $total = null): \Appwrite\Models\VariableList { @@ -4498,19 +4047,13 @@ public function listVariables(?array $queries = null, ?bool $total = null): \App } return \Appwrite\Models\VariableList::from($response); - } /** * Create a new project environment variable. These variables can be accessed * by all functions and sites in the project. * - * @param string $variableId - * @param string $key - * @param string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function createVariable(string $variableId, string $key, string $value, ?bool $secret = null): \Appwrite\Models\Variable { @@ -4546,15 +4089,12 @@ public function createVariable(string $variableId, string $key, string $value, ? } return \Appwrite\Models\Variable::from($response); - } /** - * Get a variable by its unique ID. + * Get a variable by its unique ID. * - * @param string $variableId * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function getVariable(string $variableId): \Appwrite\Models\Variable { @@ -4583,18 +4123,12 @@ public function getVariable(string $variableId): \Appwrite\Models\Variable } return \Appwrite\Models\Variable::from($response); - } /** * Update variable by its unique ID. * - * @param string $variableId - * @param ?string $key - * @param ?string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function updateVariable(string $variableId, ?string $key = null, ?string $value = null, ?bool $secret = null): \Appwrite\Models\Variable { @@ -4627,15 +4161,12 @@ public function updateVariable(string $variableId, ?string $key = null, ?string } return \Appwrite\Models\Variable::from($response); - } /** - * Delete a variable by its unique ID. + * Delete a variable by its unique ID. * - * @param string $variableId * @throws AppwriteException - * @return string */ public function deleteVariable(string $variableId): string { @@ -4652,14 +4183,11 @@ public function deleteVariable(string $variableId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Proxy.php b/src/Appwrite/Services/Proxy.php index 691efb29..4b04c9e1 100644 --- a/src/Appwrite/Services/Proxy.php +++ b/src/Appwrite/Services/Proxy.php @@ -1,34 +1,26 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -375,9 +334,7 @@ public function deleteRule(string $ruleId): string * verification is successful, a TLS certificate will be automatically * provisioned for the domain asynchronously in the background. * - * @param string $ruleId * @throws AppwriteException - * @return \Appwrite\Models\ProxyRule */ public function updateRuleStatus(string $ruleId): \Appwrite\Models\ProxyRule { @@ -407,6 +364,5 @@ public function updateRuleStatus(string $ruleId): \Appwrite\Models\ProxyRule } return \Appwrite\Models\ProxyRule::from($response); - } } diff --git a/src/Appwrite/Services/Sites.php b/src/Appwrite/Services/Sites.php index 0b373273..59b2c791 100644 --- a/src/Appwrite/Services/Sites.php +++ b/src/Appwrite/Services/Sites.php @@ -1,34 +1,28 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; @@ -207,7 +180,6 @@ public function create(string $siteId, string $name, Framework $framework, Build } return \Appwrite\Models\Site::from($response); - } /** @@ -215,7 +187,6 @@ public function create(string $siteId, string $name, Framework $framework, Build * instance. * * @throws AppwriteException - * @return \Appwrite\Models\FrameworkList */ public function listFrameworks(): \Appwrite\Models\FrameworkList { @@ -243,15 +214,12 @@ public function listFrameworks(): \Appwrite\Models\FrameworkList } return \Appwrite\Models\FrameworkList::from($response); - } /** * List allowed site specifications for this instance. * - * @param ?string $type * @throws AppwriteException - * @return \Appwrite\Models\SpecificationList */ public function listSpecifications(?string $type = null): \Appwrite\Models\SpecificationList { @@ -283,15 +251,12 @@ public function listSpecifications(?string $type = null): \Appwrite\Models\Speci } return \Appwrite\Models\SpecificationList::from($response); - } /** * Get a site by its unique ID. * - * @param string $siteId * @throws AppwriteException - * @return \Appwrite\Models\Site */ public function get(string $siteId): \Appwrite\Models\Site { @@ -320,39 +285,14 @@ public function get(string $siteId): \Appwrite\Models\Site } return \Appwrite\Models\Site::from($response); - } /** * Update site by its unique ID. * - * @param string $siteId - * @param string $name - * @param Framework $framework - * @param ?bool $enabled - * @param ?bool $logging - * @param ?int $timeout - * @param ?string $installCommand - * @param ?string $buildCommand - * @param ?string $startCommand - * @param ?string $outputDirectory - * @param ?BuildRuntime $buildRuntime - * @param ?Adapter $adapter - * @param ?string $fallbackFile - * @param ?string $installationId - * @param ?string $providerRepositoryId - * @param ?string $providerBranch - * @param ?bool $providerSilentMode - * @param ?string $providerRootDirectory - * @param ?array $providerBranches - * @param ?array $providerPaths - * @param ?string $buildSpecification - * @param ?string $runtimeSpecification - * @param ?int $deploymentRetention * @throws AppwriteException - * @return \Appwrite\Models\Site */ - public function update(string $siteId, string $name, Framework $framework, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?BuildRuntime $buildRuntime = null, ?Adapter $adapter = null, ?string $fallbackFile = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?array $providerBranches = null, ?array $providerPaths = null, ?string $buildSpecification = null, ?string $runtimeSpecification = null, ?int $deploymentRetention = null): \Appwrite\Models\Site + public function update(string $siteId, string $name, Framework $framework, ?bool $enabled = null, ?bool $logging = null, ?int $timeout = null, ?string $installCommand = null, ?string $buildCommand = null, ?string $startCommand = null, ?string $outputDirectory = null, ?BuildRuntime $buildRuntime = null, ?Adapter $adapter = null, ?string $fallbackFile = null, ?string $installationId = null, ?string $providerRepositoryId = null, ?string $providerBranch = null, ?bool $providerSilentMode = null, ?string $providerRootDirectory = null, ?array $providerBranches = null, ?array $providerPaths = null, ?string $buildSpecification = null, ?string $runtimeSpecification = null, ?int $deploymentRetention = null, ?array $scopes = null): \Appwrite\Models\Site { $apiPath = str_replace( ['{siteId}'], @@ -435,6 +375,7 @@ public function update(string $siteId, string $name, Framework $framework, ?bool if (!is_null($deploymentRetention)) { $apiParams['deploymentRetention'] = $deploymentRetention; } + $apiParams['scopes'] = $scopes; $apiHeaders = []; $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); @@ -453,15 +394,12 @@ public function update(string $siteId, string $name, Framework $framework, ?bool } return \Appwrite\Models\Site::from($response); - } /** * Delete a site by its unique ID. * - * @param string $siteId * @throws AppwriteException - * @return string */ public function delete(string $siteId): string { @@ -478,25 +416,19 @@ public function delete(string $siteId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the site active deployment. Use this endpoint to switch the code * deployment that should be used when visitor opens your site. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Site */ public function updateSiteDeployment(string $siteId, string $deploymentId): \Appwrite\Models\Site { @@ -527,19 +459,13 @@ public function updateSiteDeployment(string $siteId, string $deploymentId): \App } return \Appwrite\Models\Site::from($response); - } /** * Get a list of all the site's code deployments. You can use the query params * to filter your results. * - * @param string $siteId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\DeploymentList */ public function listDeployments(string $siteId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\DeploymentList { @@ -580,7 +506,6 @@ public function listDeployments(string $siteId, ?array $queries = null, ?string } return \Appwrite\Models\DeploymentList::from($response); - } /** @@ -588,14 +513,7 @@ public function listDeployments(string $siteId, ?array $queries = null, ?string * version of your site code. To activate your newly uploaded code, you'll * need to update the site's deployment to use your new deployment ID. * - * @param string $siteId - * @param InputFile $code - * @param ?string $installCommand - * @param ?string $buildCommand - * @param ?string $outputDirectory - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createDeployment(string $siteId, InputFile $code, ?string $installCommand = null, ?string $buildCommand = null, ?string $outputDirectory = null, ?bool $activate = null, ?callable $onProgress = null): \Appwrite\Models\Deployment { @@ -632,12 +550,12 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta $size = 0; $mimeType = null; $postedName = null; - if(empty($code->getPath() ?? null)) { + if (empty($code->getPath() ?? null)) { $size = strlen($code->getData()); $mimeType = $code->getMimeType(); $postedName = $code->getFilename(); if ($size <= Client::CHUNK_SIZE) { - $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($code->getData()), $mimeType, $postedName); + $apiParams['code'] = Part::body('code', $code->getData(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -654,7 +572,7 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta $postedName = $code->getFilename() ?? basename($code->getPath()); //send single file if size is less than or equal to 5MB if ($size <= Client::CHUNK_SIZE) { - $apiParams['code'] = new \CURLFile($code->getPath(), $mimeType, $postedName); + $apiParams['code'] = Part::file('code', $code->getPath(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -667,7 +585,6 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta } } - $id = ''; $counter = 0; @@ -678,12 +595,12 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta ]; $handle = null; - if(!empty($code->getPath())) { + if (!empty($code->getPath())) { $handle = @fopen($code->getPath(), "rb"); } $uploadId = ''; - $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { @@ -696,8 +613,8 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta $start += Client::CHUNK_SIZE; } - $readChunk = function(int $start, int $end) use ($handle, $code) { - if(!empty($handle)) { + $readChunk = function (int $start, int $end) use ($handle, $code): string|false { + if (!empty($handle)) { fseek($handle, $start); return @fread($handle, $end - $start); } @@ -705,173 +622,67 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta return substr($code->getData(), $start, $end - $start); }; - $uploadChunk = function(array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { + $uploadChunk = function (array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { $chunkParams = $apiParams; $chunkHeaders = $apiHeaders; $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); + if (!is_string($data)) { + throw new AppwriteException('Failed to read upload chunk'); + } + $chunkParams['code'] = Part::body('code', $data, $postedName, $mimeType); $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($currentUploadId)) { + if (!empty($currentUploadId)) { $chunkHeaders['x-appwrite-id'] = $currentUploadId; } return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); }; - $isUploadComplete = function($chunkResponse) use ($totalChunks): bool { - if(!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { + $isUploadComplete = function ($chunkResponse) use ($totalChunks): bool { + if (!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { return false; } return (int) $chunkResponse['chunksUploaded'] >= (int) ($chunkResponse['chunksTotal'] ?? $totalChunks); }; - if (!empty($chunks)) { - $response = $uploadChunk($chunks[0], $uploadId); - if(empty($uploadId)) { - $uploadId = $response['$id']; + $response = $uploadChunk($chunks[0], $uploadId); + $uploadId = $response['$id']; + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; + if ($onProgress !== null) { + $onProgress([ + '$id' => $response['$id'], + 'progress' => $uploadedSize / $size * 100, + 'sizeUploaded' => $uploadedSize, + 'chunksTotal' => $totalChunks, + 'chunksUploaded' => $completedCount, + ]); + } + + $remainingChunks = array_slice($chunks, 1); + $completedResponse = $isUploadComplete($response) ? $response : null; + + foreach ($remainingChunks as $chunk) { + $response = $uploadChunk($chunk, $uploadId); + $completedCount++; + $uploadedSize += $chunk['end'] - $chunk['start']; + if ($isUploadComplete($response)) { + $completedResponse = $response; } - $completedCount = $chunks[0]['index'] + 1; - $uploadedSize = $chunks[0]['end']; - if($onProgress !== null) { + if ($onProgress !== null) { $onProgress([ - '$id' => $response['$id'], + '$id' => $uploadId, 'progress' => $uploadedSize / $size * 100, 'sizeUploaded' => $uploadedSize, 'chunksTotal' => $totalChunks, 'chunksUploaded' => $completedCount, ]); } - - $remainingChunks = array_slice($chunks, 1); - $clientConfig = \Closure::bind(function() { - if (property_exists($this, 'key') && $this->key !== null) { - $this->headers['authorization'] = $this->getAuthorization(); - } - - return [$this->endpoint, $this->headers, $this->selfSigned, $this->timeout, $this->connectTimeout]; - }, $this->client, Client::class); - $flattenParams = \Closure::bind(function(array $params): array { - return $this->flatten($params); - }, $this->client, Client::class); - [$endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout] = $clientConfig(); - $responseHeaders = []; - $lastResponse = $response; - $completedResponse = null; - - $makeHandle = function(array $chunk) use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size, $uploadId, $endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout, $flattenParams, &$responseHeaders) { - $chunkParams = $apiParams; - $chunkHeaders = array_merge($globalHeaders, $apiHeaders); - $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); - $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($uploadId)) { - $chunkHeaders['x-appwrite-id'] = $uploadId; - } - - $headers = []; - foreach ($chunkHeaders as $key => $value) { - $headers[] = $key . ':' . $value; - } - - $ch = curl_init($endpoint . $apiPath); - $responseHeaders[spl_object_id($ch)] = []; - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, Client::METHOD_POST); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $flattenParams($chunkParams)); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $length = strlen($header); - $header = explode(':', strtolower($header), 2); - if (count($header) >= 2) { - $responseHeaders[spl_object_id($curl)][strtolower(trim($header[0]))] = trim($header[1]); - } - - return $length; - }); - if($selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - } - if($timeout !== null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - } - if($connectTimeout !== null) { - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connectTimeout); - } - - return $ch; - }; - - $nextChunk = 0; - while ($nextChunk < count($remainingChunks)) { - $multiHandle = curl_multi_init(); - $handles = []; - for ($i = 0; $i < 8 && $nextChunk < count($remainingChunks); $i++, $nextChunk++) { - $chunk = $remainingChunks[$nextChunk]; - $ch = $makeHandle($chunk); - $handles[spl_object_id($ch)] = ['handle' => $ch, 'chunk' => $chunk]; - curl_multi_add_handle($multiHandle, $ch); - } - - try { - do { - $status = curl_multi_exec($multiHandle, $active); - if ($active) { - curl_multi_select($multiHandle); - } - } while ($active && ($status == CURLM_OK || $status == CURLM_CALL_MULTI_PERFORM)); - - foreach ($handles as $handleInfo) { - $ch = $handleInfo['handle']; - $body = curl_multi_getcontent($ch); - $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $contentType = $responseHeaders[spl_object_id($ch)]['content-type'] ?? ''; - - if (curl_errno($ch)) { - throw new AppwriteException(curl_error($ch), $statusCode, '', $body); - } - - $chunkResponse = str_starts_with($contentType, 'application/json') ? json_decode($body, true) : $body; - - if($statusCode >= 400) { - if(is_array($chunkResponse)) { - throw new AppwriteException($chunkResponse['message'], $statusCode, $chunkResponse['type'] ?? '', json_encode($chunkResponse)); - } - - throw new AppwriteException($chunkResponse, $statusCode, '', $chunkResponse); - } - - $completedCount++; - $uploadedSize += $handleInfo['chunk']['end'] - $handleInfo['chunk']['start']; - $lastResponse = $chunkResponse; - if($isUploadComplete($chunkResponse)) { - $completedResponse = $chunkResponse; - } - if($onProgress !== null) { - $onProgress([ - '$id' => $uploadId, - 'progress' => $uploadedSize / $size * 100, - 'sizeUploaded' => $uploadedSize, - 'chunksTotal' => $totalChunks, - 'chunksUploaded' => $completedCount, - ]); - } - } - } finally { - foreach ($handles as $handleInfo) { - curl_multi_remove_handle($multiHandle, $handleInfo['handle']); - curl_close($handleInfo['handle']); - } - curl_multi_close($multiHandle); - } - } - $response = $completedResponse ?? $lastResponse; - } - if(!empty($handle)) { + + $response = $completedResponse ?? $response; + if (!empty($handle)) { @fclose($handle); } if (!is_array($response)) { @@ -879,7 +690,6 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta } return \Appwrite\Models\Deployment::from($response); - } /** @@ -889,10 +699,7 @@ public function createDeployment(string $siteId, InputFile $code, ?string $insta * process will be queued and executed asynchronously. The original * deployment's code will be preserved and used for the new build. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createDuplicateDeployment(string $siteId, string $deploymentId): \Appwrite\Models\Deployment { @@ -923,25 +730,16 @@ public function createDuplicateDeployment(string $siteId, string $deploymentId): } return \Appwrite\Models\Deployment::from($response); - } /** * Create a deployment based on a template. - * + * * Use this endpoint with combination of * [listTemplates](https://appwrite.io/docs/products/sites/templates) to find * the template details. * - * @param string $siteId - * @param string $repository - * @param string $owner - * @param string $rootDirectory - * @param TemplateReferenceType $type - * @param string $reference - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createTemplateDeployment(string $siteId, string $repository, string $owner, string $rootDirectory, TemplateReferenceType $type, string $reference, ?bool $activate = null): \Appwrite\Models\Deployment { @@ -980,20 +778,14 @@ public function createTemplateDeployment(string $siteId, string $repository, str } return \Appwrite\Models\Deployment::from($response); - } /** * Create a deployment when a site is connected to VCS. - * + * * This endpoint lets you create deployment from a branch, commit, or a tag. * - * @param string $siteId - * @param VCSReferenceType $type - * @param string $reference - * @param ?bool $activate * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function createVcsDeployment(string $siteId, VCSReferenceType $type, string $reference, ?bool $activate = null): \Appwrite\Models\Deployment { @@ -1029,16 +821,12 @@ public function createVcsDeployment(string $siteId, VCSReferenceType $type, stri } return \Appwrite\Models\Deployment::from($response); - } /** * Get a site deployment by its unique ID. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function getDeployment(string $siteId, string $deploymentId): \Appwrite\Models\Deployment { @@ -1068,16 +856,12 @@ public function getDeployment(string $siteId, string $deploymentId): \Appwrite\M } return \Appwrite\Models\Deployment::from($response); - } /** * Delete a site deployment by its unique ID. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return string */ public function deleteDeployment(string $siteId, string $deploymentId): string { @@ -1095,15 +879,12 @@ public function deleteDeployment(string $siteId, string $deploymentId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1111,12 +892,7 @@ public function deleteDeployment(string $siteId, string $deploymentId): string * return with a 'Content-Disposition: attachment' header that tells the * browser to start downloading the file to user downloads directory. * - * @param string $siteId - * @param string $deploymentId - * @param ?DeploymentDownloadType $type - * @param ?string $token * @throws AppwriteException - * @return string */ public function getDeploymentDownload(string $siteId, string $deploymentId, ?DeploymentDownloadType $type = null, ?string $token = null): string { @@ -1142,15 +918,12 @@ public function getDeploymentDownload(string $siteId, string $deploymentId, ?Dep $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1160,10 +933,7 @@ public function getDeploymentDownload(string $siteId, string $deploymentId, ?Dep * cancel builds that have already completed (status 'ready') or failed. The * response includes the final build status and details. * - * @param string $siteId - * @param string $deploymentId * @throws AppwriteException - * @return \Appwrite\Models\Deployment */ public function updateDeploymentStatus(string $siteId, string $deploymentId): \Appwrite\Models\Deployment { @@ -1194,18 +964,13 @@ public function updateDeploymentStatus(string $siteId, string $deploymentId): \A } return \Appwrite\Models\Deployment::from($response); - } /** * Get a list of all site logs. You can use the query params to filter your * results. * - * @param string $siteId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ExecutionList */ public function listLogs(string $siteId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\ExecutionList { @@ -1242,16 +1007,12 @@ public function listLogs(string $siteId, ?array $queries = null, ?bool $total = } return \Appwrite\Models\ExecutionList::from($response); - } /** * Get a site request log by its unique ID. * - * @param string $siteId - * @param string $logId * @throws AppwriteException - * @return \Appwrite\Models\Execution */ public function getLog(string $siteId, string $logId): \Appwrite\Models\Execution { @@ -1281,16 +1042,12 @@ public function getLog(string $siteId, string $logId): \Appwrite\Models\Executio } return \Appwrite\Models\Execution::from($response); - } /** * Delete a site log by its unique ID. * - * @param string $siteId - * @param string $logId * @throws AppwriteException - * @return string */ public function deleteLog(string $siteId, string $logId): string { @@ -1309,25 +1066,18 @@ public function deleteLog(string $siteId, string $logId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all variables of a specific site. * - * @param string $siteId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\VariableList */ public function listVariables(string $siteId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\VariableList { @@ -1364,20 +1114,13 @@ public function listVariables(string $siteId, ?array $queries = null, ?bool $tot } return \Appwrite\Models\VariableList::from($response); - } /** * Create a new site variable. These variables can be accessed during build * and runtime (server-side rendering) as environment variables. * - * @param string $siteId - * @param string $variableId - * @param string $key - * @param string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function createVariable(string $siteId, string $variableId, string $key, string $value, ?bool $secret = null): \Appwrite\Models\Variable { @@ -1414,16 +1157,12 @@ public function createVariable(string $siteId, string $variableId, string $key, } return \Appwrite\Models\Variable::from($response); - } /** * Get a variable by its unique ID. * - * @param string $siteId - * @param string $variableId * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function getVariable(string $siteId, string $variableId): \Appwrite\Models\Variable { @@ -1453,19 +1192,12 @@ public function getVariable(string $siteId, string $variableId): \Appwrite\Model } return \Appwrite\Models\Variable::from($response); - } /** * Update variable by its unique ID. * - * @param string $siteId - * @param string $variableId - * @param ?string $key - * @param ?string $value - * @param ?bool $secret * @throws AppwriteException - * @return \Appwrite\Models\Variable */ public function updateVariable(string $siteId, string $variableId, ?string $key = null, ?string $value = null, ?bool $secret = null): \Appwrite\Models\Variable { @@ -1499,16 +1231,12 @@ public function updateVariable(string $siteId, string $variableId, ?string $key } return \Appwrite\Models\Variable::from($response); - } /** * Delete a variable by its unique ID. * - * @param string $siteId - * @param string $variableId * @throws AppwriteException - * @return string */ public function deleteVariable(string $siteId, string $variableId): string { @@ -1526,14 +1254,11 @@ public function deleteVariable(string $siteId, string $variableId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Storage.php b/src/Appwrite/Services/Storage.php index 1c273971..ed3a2e93 100644 --- a/src/Appwrite/Services/Storage.php +++ b/src/Appwrite/Services/Storage.php @@ -1,31 +1,25 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all the user files. You can use the query params to filter * your results. * - * @param string $bucketId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\FileList */ public function listFiles(string $bucketId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\FileList { @@ -353,7 +307,6 @@ public function listFiles(string $bucketId, ?array $queries = null, ?string $sea } return \Appwrite\Models\FileList::from($response); - } /** @@ -361,28 +314,21 @@ public function listFiles(string $bucketId, ?array $queries = null, ?string $sea * resource using either a [server * integration](https://appwrite.io/docs/server/storage#storageCreateBucket) * API or directly from your Appwrite console. - * + * * Larger files should be uploaded using multiple requests with the * [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) * header to send a partial request with a maximum supported chunk of `5MB`. * The `content-range` header values should always be in bytes. - * + * * When the first request is sent, the server will return the **File** object, * and the subsequent part request must include the file's **id** in * `x-appwrite-id` header to allow the server to know that the partial upload * is for the existing file and not for a new one. - * + * * If you're creating a new file using one of the Appwrite SDKs, all the * chunking logic will be managed by the SDK internally. - * * - * @param string $bucketId - * @param string $fileId - * @param InputFile $file - * @param ?array $permissions - * @param ?string $folder * @throws AppwriteException - * @return \Appwrite\Models\File */ public function createFile(string $bucketId, string $fileId, InputFile $file, ?array $permissions = null, ?string $folder = null, ?callable $onProgress = null): \Appwrite\Models\File { @@ -412,12 +358,12 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a $size = 0; $mimeType = null; $postedName = null; - if(empty($file->getPath() ?? null)) { + if (empty($file->getPath() ?? null)) { $size = strlen($file->getData()); $mimeType = $file->getMimeType(); $postedName = $file->getFilename(); if ($size <= Client::CHUNK_SIZE) { - $apiParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($file->getData()), $mimeType, $postedName); + $apiParams['file'] = Part::body('file', $file->getData(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -434,7 +380,7 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a $postedName = $file->getFilename() ?? basename($file->getPath()); //send single file if size is less than or equal to 5MB if ($size <= Client::CHUNK_SIZE) { - $apiParams['file'] = new \CURLFile($file->getPath(), $mimeType, $postedName); + $apiParams['file'] = Part::file('file', $file->getPath(), $postedName, $mimeType); $response = $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', 'accept' => 'application/json', @@ -447,13 +393,13 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a } } - $id = ''; $counter = 0; + $response = null; try { $response = $this->client->call(Client::METHOD_GET, $apiPath . '/' . $fileId); $counter = $response['chunksUploaded'] ?? 0; - } catch(\Exception $e) { + } catch (\Exception) { } $apiHeaders = [ @@ -463,13 +409,12 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a ]; $handle = null; - if(!empty($file->getPath())) { + if (!empty($file->getPath())) { $handle = @fopen($file->getPath(), "rb"); } - $uploadId = ''; - $uploadId = $fileId ?? ''; - $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); + $uploadId = $fileId; + $totalChunks = (int) ceil($size / Client::CHUNK_SIZE); $chunks = []; $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { @@ -482,8 +427,16 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a $start += Client::CHUNK_SIZE; } - $readChunk = function(int $start, int $end) use ($handle, $file) { - if(!empty($handle)) { + if ($chunks === []) { + if (!is_array($response)) { + throw new \UnexpectedValueException('Expected array response when hydrating a response model.'); + } + + return \Appwrite\Models\File::from($response); + } + + $readChunk = function (int $start, int $end) use ($handle, $file): string|false { + if (!empty($handle)) { fseek($handle, $start); return @fread($handle, $end - $start); } @@ -491,173 +444,66 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a return substr($file->getData(), $start, $end - $start); }; - $uploadChunk = function(array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { + $uploadChunk = function (array $chunk, string $currentUploadId = '') use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size) { $chunkParams = $apiParams; $chunkHeaders = $apiHeaders; $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); + if (!is_string($data)) { + throw new AppwriteException('Failed to read upload chunk'); + } + $chunkParams['file'] = Part::body('file', $data, $postedName, $mimeType); $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($currentUploadId)) { + if (!empty($currentUploadId)) { $chunkHeaders['x-appwrite-id'] = $currentUploadId; } return $this->client->call(Client::METHOD_POST, $apiPath, $chunkHeaders, $chunkParams); }; - $isUploadComplete = function($chunkResponse) use ($totalChunks): bool { - if(!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { + $isUploadComplete = function ($chunkResponse) use ($totalChunks): bool { + if (!is_array($chunkResponse) || !isset($chunkResponse['chunksUploaded'])) { return false; } return (int) $chunkResponse['chunksUploaded'] >= (int) ($chunkResponse['chunksTotal'] ?? $totalChunks); }; - if (!empty($chunks)) { - $response = $uploadChunk($chunks[0], $uploadId); - if(empty($uploadId)) { - $uploadId = $response['$id']; + $response = $uploadChunk($chunks[0], $uploadId); + $completedCount = $chunks[0]['index'] + 1; + $uploadedSize = $chunks[0]['end']; + if ($onProgress !== null) { + $onProgress([ + '$id' => $response['$id'], + 'progress' => $uploadedSize / $size * 100, + 'sizeUploaded' => $uploadedSize, + 'chunksTotal' => $totalChunks, + 'chunksUploaded' => $completedCount, + ]); + } + + $remainingChunks = array_slice($chunks, 1); + $completedResponse = $isUploadComplete($response) ? $response : null; + + foreach ($remainingChunks as $chunk) { + $response = $uploadChunk($chunk, $uploadId); + $completedCount++; + $uploadedSize += $chunk['end'] - $chunk['start']; + if ($isUploadComplete($response)) { + $completedResponse = $response; } - $completedCount = $chunks[0]['index'] + 1; - $uploadedSize = $chunks[0]['end']; - if($onProgress !== null) { + if ($onProgress !== null) { $onProgress([ - '$id' => $response['$id'], + '$id' => $uploadId, 'progress' => $uploadedSize / $size * 100, 'sizeUploaded' => $uploadedSize, 'chunksTotal' => $totalChunks, 'chunksUploaded' => $completedCount, ]); } - - $remainingChunks = array_slice($chunks, 1); - $clientConfig = \Closure::bind(function() { - if (property_exists($this, 'key') && $this->key !== null) { - $this->headers['authorization'] = $this->getAuthorization(); - } - - return [$this->endpoint, $this->headers, $this->selfSigned, $this->timeout, $this->connectTimeout]; - }, $this->client, Client::class); - $flattenParams = \Closure::bind(function(array $params): array { - return $this->flatten($params); - }, $this->client, Client::class); - [$endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout] = $clientConfig(); - $responseHeaders = []; - $lastResponse = $response; - $completedResponse = null; - - $makeHandle = function(array $chunk) use ($readChunk, $apiPath, $apiHeaders, $apiParams, $mimeType, $postedName, $size, $uploadId, $endpoint, $globalHeaders, $selfSigned, $timeout, $connectTimeout, $flattenParams, &$responseHeaders) { - $chunkParams = $apiParams; - $chunkHeaders = array_merge($globalHeaders, $apiHeaders); - $data = $readChunk($chunk['start'], $chunk['end']); - $chunkParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($data), $mimeType, $postedName); - $chunkHeaders['content-range'] = 'bytes ' . $chunk['start'] . '-' . ($chunk['end'] - 1) . '/' . $size; - if(!empty($uploadId)) { - $chunkHeaders['x-appwrite-id'] = $uploadId; - } - - $headers = []; - foreach ($chunkHeaders as $key => $value) { - $headers[] = $key . ':' . $value; - } - - $ch = curl_init($endpoint . $apiPath); - $responseHeaders[spl_object_id($ch)] = []; - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, Client::METHOD_POST); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $flattenParams($chunkParams)); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $length = strlen($header); - $header = explode(':', strtolower($header), 2); - if (count($header) >= 2) { - $responseHeaders[spl_object_id($curl)][strtolower(trim($header[0]))] = trim($header[1]); - } - - return $length; - }); - if($selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - } - if($timeout !== null) { - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - } - if($connectTimeout !== null) { - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connectTimeout); - } - - return $ch; - }; - - $nextChunk = 0; - while ($nextChunk < count($remainingChunks)) { - $multiHandle = curl_multi_init(); - $handles = []; - for ($i = 0; $i < 8 && $nextChunk < count($remainingChunks); $i++, $nextChunk++) { - $chunk = $remainingChunks[$nextChunk]; - $ch = $makeHandle($chunk); - $handles[spl_object_id($ch)] = ['handle' => $ch, 'chunk' => $chunk]; - curl_multi_add_handle($multiHandle, $ch); - } - - try { - do { - $status = curl_multi_exec($multiHandle, $active); - if ($active) { - curl_multi_select($multiHandle); - } - } while ($active && ($status == CURLM_OK || $status == CURLM_CALL_MULTI_PERFORM)); - - foreach ($handles as $handleInfo) { - $ch = $handleInfo['handle']; - $body = curl_multi_getcontent($ch); - $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $contentType = $responseHeaders[spl_object_id($ch)]['content-type'] ?? ''; - - if (curl_errno($ch)) { - throw new AppwriteException(curl_error($ch), $statusCode, '', $body); - } - - $chunkResponse = str_starts_with($contentType, 'application/json') ? json_decode($body, true) : $body; - - if($statusCode >= 400) { - if(is_array($chunkResponse)) { - throw new AppwriteException($chunkResponse['message'], $statusCode, $chunkResponse['type'] ?? '', json_encode($chunkResponse)); - } - - throw new AppwriteException($chunkResponse, $statusCode, '', $chunkResponse); - } - - $completedCount++; - $uploadedSize += $handleInfo['chunk']['end'] - $handleInfo['chunk']['start']; - $lastResponse = $chunkResponse; - if($isUploadComplete($chunkResponse)) { - $completedResponse = $chunkResponse; - } - if($onProgress !== null) { - $onProgress([ - '$id' => $uploadId, - 'progress' => $uploadedSize / $size * 100, - 'sizeUploaded' => $uploadedSize, - 'chunksTotal' => $totalChunks, - 'chunksUploaded' => $completedCount, - ]); - } - } - } finally { - foreach ($handles as $handleInfo) { - curl_multi_remove_handle($multiHandle, $handleInfo['handle']); - curl_close($handleInfo['handle']); - } - curl_multi_close($multiHandle); - } - } - $response = $completedResponse ?? $lastResponse; - } - if(!empty($handle)) { + + $response = $completedResponse ?? $response; + if (!empty($handle)) { @fclose($handle); } if (!is_array($response)) { @@ -665,17 +511,13 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ?a } return \Appwrite\Models\File::from($response); - } /** * Get a file by its unique ID. This endpoint response returns a JSON object * with the file metadata. * - * @param string $bucketId - * @param string $fileId * @throws AppwriteException - * @return \Appwrite\Models\File */ public function getFile(string $bucketId, string $fileId): \Appwrite\Models\File { @@ -705,19 +547,13 @@ public function getFile(string $bucketId, string $fileId): \Appwrite\Models\File } return \Appwrite\Models\File::from($response); - } /** * Update a file by its unique ID. Only users with write permissions have * access to update this resource. * - * @param string $bucketId - * @param string $fileId - * @param ?string $name - * @param ?array $permissions * @throws AppwriteException - * @return \Appwrite\Models\File */ public function updateFile(string $bucketId, string $fileId, ?string $name = null, ?array $permissions = null): \Appwrite\Models\File { @@ -753,17 +589,13 @@ public function updateFile(string $bucketId, string $fileId, ?string $name = nul } return \Appwrite\Models\File::from($response); - } /** * Delete a file by its unique ID. Only users with write permissions have * access to delete this resource. * - * @param string $bucketId - * @param string $fileId * @throws AppwriteException - * @return string */ public function deleteFile(string $bucketId, string $fileId): string { @@ -781,15 +613,12 @@ public function deleteFile(string $bucketId, string $fileId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -797,11 +626,7 @@ public function deleteFile(string $bucketId, string $fileId): string * 'Content-Disposition: attachment' header that tells the browser to start * downloading the file to user downloads directory. * - * @param string $bucketId - * @param string $fileId - * @param ?string $token * @throws AppwriteException - * @return string */ public function getFileDownload(string $bucketId, string $fileId, ?string $token = null): string { @@ -823,15 +648,12 @@ public function getFileDownload(string $bucketId, string $fileId, ?string $token $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -841,22 +663,7 @@ public function getFileDownload(string $bucketId, string $fileId, ?string $token * string arguments for cutting and resizing your preview image. Preview is * supported only for image files smaller than 10MB. * - * @param string $bucketId - * @param string $fileId - * @param ?int $width - * @param ?int $height - * @param ?ImageGravity $gravity - * @param ?int $quality - * @param ?int $borderWidth - * @param ?string $borderColor - * @param ?int $borderRadius - * @param ?float $opacity - * @param ?int $rotation - * @param ?string $background - * @param ?ImageFormat $output - * @param ?string $token * @throws AppwriteException - * @return string */ public function getFilePreview(string $bucketId, string $fileId, ?int $width = null, ?int $height = null, ?ImageGravity $gravity = null, ?int $quality = null, ?int $borderWidth = null, ?string $borderColor = null, ?int $borderRadius = null, ?float $opacity = null, ?int $rotation = null, ?string $background = null, ?ImageFormat $output = null, ?string $token = null): string { @@ -922,15 +729,12 @@ public function getFilePreview(string $bucketId, string $fileId, ?int $width = n $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = 'image/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -938,11 +742,7 @@ public function getFilePreview(string $bucketId, string $fileId, ?int $width = n * download method but returns with no 'Content-Disposition: attachment' * header. * - * @param string $bucketId - * @param string $fileId - * @param ?string $token * @throws AppwriteException - * @return string */ public function getFileView(string $bucketId, string $fileId, ?string $token = null): string { @@ -964,14 +764,11 @@ public function getFileView(string $bucketId, string $fileId, ?string $token = n $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['accept'] = '*/*'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_GET, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/TablesDB.php b/src/Appwrite/Services/TablesDB.php index c8a8d30e..8bdd3dd7 100644 --- a/src/Appwrite/Services/TablesDB.php +++ b/src/Appwrite/Services/TablesDB.php @@ -1,32 +1,23 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Create multiple operations in a single transaction. * - * @param string $transactionId - * @param ?array $operations * @throws AppwriteException - * @return \Appwrite\Models\Transaction */ public function createOperations(string $transactionId, ?array $operations = null): \Appwrite\Models\Transaction { @@ -403,16 +360,13 @@ public function createOperations(string $transactionId, ?array $operations = nul } return \Appwrite\Models\Transaction::from($response); - } /** * Get a database by its unique ID. This endpoint response returns a JSON * object with the database metadata. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\Database */ public function get(string $databaseId): \Appwrite\Models\Database { @@ -441,20 +395,12 @@ public function get(string $databaseId): \Appwrite\Models\Database } return \Appwrite\Models\Database::from($response); - } /** * Update a database by its unique ID. * - * @param string $databaseId - * @param ?string $name - * @param ?bool $enabled - * @param ?string $specification - * @param ?int $replicas - * @param ?string $syncMode * @throws AppwriteException - * @return \Appwrite\Models\Database */ public function update(string $databaseId, ?string $name = null, ?bool $enabled = null, ?string $specification = null, ?int $replicas = null, ?string $syncMode = null): \Appwrite\Models\Database { @@ -495,16 +441,13 @@ public function update(string $databaseId, ?string $name = null, ?bool $enabled } return \Appwrite\Models\Database::from($response); - } /** * Delete a database by its unique ID. Only API keys with with databases.write * scope can delete a database. * - * @param string $databaseId * @throws AppwriteException - * @return string */ public function delete(string $databaseId): string { @@ -521,28 +464,26 @@ public function delete(string $databaseId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Trigger a manual failover for a dedicated database with high availability * enabled. Promotes a replica to primary. The failover runs asynchronously; * poll the database document for status updates. A database left - * mid-operation by a failover that did not finish also accepts this call as a - * repair, provided `targetReplicaId` names the member to promote. + * mid-operation also accepts this call as a repair once nothing is driving + * the operation it is stuck in. Repairing a failover that did not finish, a + * `failed` database, a stranded upgrade or migrate, or a stranded compute + * resize additionally requires `targetReplicaId` to name the member to + * promote, because the default target may be the member that operation + * already promoted. * - * @param string $databaseId - * @param ?string $targetReplicaId * @throws AppwriteException - * @return \Appwrite\Models\DedicatedDatabase */ public function createFailover(string $databaseId, ?string $targetReplicaId = null): \Appwrite\Models\DedicatedDatabase { @@ -573,16 +514,13 @@ public function createFailover(string $databaseId, ?string $targetReplicaId = nu } return \Appwrite\Models\DedicatedDatabase::from($response); - } /** * List the dedicated migrations for a TablesDB database. A database has at * most one in-flight migration. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\DatabaseMigrationList */ public function listMigrations(string $databaseId): \Appwrite\Models\DatabaseMigrationList { @@ -611,7 +549,6 @@ public function listMigrations(string $databaseId): \Appwrite\Models\DatabaseMig } return \Appwrite\Models\DatabaseMigrationList::from($response); - } /** @@ -619,11 +556,7 @@ public function listMigrations(string $databaseId): \Appwrite\Models\DatabaseMig * compute. Data is copied to the target while the source stays live, with a * brief read-only window during cutover. * - * @param string $databaseId - * @param string $specification - * @param ?bool $autoCutover * @throws AppwriteException - * @return \Appwrite\Models\DatabaseMigration */ public function createMigration(string $databaseId, string $specification, ?bool $autoCutover = null): \Appwrite\Models\DatabaseMigration { @@ -658,16 +591,12 @@ public function createMigration(string $databaseId, string $specification, ?bool } return \Appwrite\Models\DatabaseMigration::from($response); - } /** * Get a single dedicated migration for a TablesDB database by its ID. * - * @param string $databaseId - * @param string $migrationId * @throws AppwriteException - * @return \Appwrite\Models\DatabaseMigration */ public function getMigration(string $databaseId, string $migrationId): \Appwrite\Models\DatabaseMigration { @@ -697,17 +626,13 @@ public function getMigration(string $databaseId, string $migrationId): \Appwrite } return \Appwrite\Models\DatabaseMigration::from($response); - } /** * Abort an in-flight TablesDB dedicated migration. Only allowed before * cutover; once the migration has cut over it cannot be aborted. * - * @param string $databaseId - * @param string $migrationId * @throws AppwriteException - * @return string */ public function deleteMigration(string $databaseId, string $migrationId): string { @@ -726,15 +651,12 @@ public function deleteMigration(string $databaseId, string $migrationId): string $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -745,10 +667,7 @@ public function deleteMigration(string $databaseId, string $migrationId): string * attempt: a cutover that fails a check returns the migration to `verifying` * and parks it again, so call this once more to retry. * - * @param string $databaseId - * @param string $migrationId * @throws AppwriteException - * @return \Appwrite\Models\DatabaseMigration */ public function cutoverMigration(string $databaseId, string $migrationId): \Appwrite\Models\DatabaseMigration { @@ -779,7 +698,6 @@ public function cutoverMigration(string $databaseId, string $migrationId): \Appw } return \Appwrite\Models\DatabaseMigration::from($response); - } /** @@ -788,12 +706,7 @@ public function cutoverMigration(string $databaseId, string $migrationId): \Appw * recorded here with its outcome, including an attempt that was abandoned * because another worker took over the database. * - * @param string $databaseId - * @param ?string $status - * @param ?int $limit - * @param ?int $offset * @throws AppwriteException - * @return \Appwrite\Models\DedicatedDatabaseOperationList */ public function listOperations(string $databaseId, ?string $status = null, ?int $limit = null, ?int $offset = null): \Appwrite\Models\DedicatedDatabaseOperationList { @@ -834,16 +747,13 @@ public function listOperations(string $databaseId, ?string $status = null, ?int } return \Appwrite\Models\DedicatedDatabaseOperationList::from($response); - } /** * Get high availability status for a dedicated database. Returns replica * statuses, replication lag, and sync mode. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\DedicatedDatabaseReplicas */ public function getReplicas(string $databaseId): \Appwrite\Models\DedicatedDatabaseReplicas { @@ -872,7 +782,6 @@ public function getReplicas(string $databaseId): \Appwrite\Models\DedicatedDatab } return \Appwrite\Models\DedicatedDatabaseReplicas::from($response); - } /** @@ -880,9 +789,7 @@ public function getReplicas(string $databaseId): \Appwrite\Models\DedicatedDatab * Returns health status, readiness, uptime, connection info, replica status, * and volume information. * - * @param string $databaseId * @throws AppwriteException - * @return \Appwrite\Models\DatabaseStatus */ public function getStatus(string $databaseId): \Appwrite\Models\DatabaseStatus { @@ -911,19 +818,13 @@ public function getStatus(string $databaseId): \Appwrite\Models\DatabaseStatus } return \Appwrite\Models\DatabaseStatus::from($response); - } /** * Get a list of all tables that belong to the provided databaseId. You can * use the search parameter to filter your results. * - * @param string $databaseId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\TableList */ public function listTables(string $databaseId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\TableList { @@ -964,7 +865,6 @@ public function listTables(string $databaseId, ?array $queries = null, ?string $ } return \Appwrite\Models\TableList::from($response); - } /** @@ -973,16 +873,7 @@ public function listTables(string $databaseId, ?array $queries = null, ?string $ * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. * - * @param string $databaseId - * @param string $tableId - * @param string $name - * @param ?array $permissions - * @param ?bool $rowSecurity - * @param ?bool $enabled - * @param ?array $columns - * @param ?array $indexes * @throws AppwriteException - * @return \Appwrite\Models\Table */ public function createTable(string $databaseId, string $tableId, string $name, ?array $permissions = null, ?bool $rowSecurity = null, ?bool $enabled = null, ?array $columns = null, ?array $indexes = null): \Appwrite\Models\Table { @@ -1031,17 +922,13 @@ public function createTable(string $databaseId, string $tableId, string $name, ? } return \Appwrite\Models\Table::from($response); - } /** * Get a table by its unique ID. This endpoint response returns a JSON object * with the table metadata. * - * @param string $databaseId - * @param string $tableId * @throws AppwriteException - * @return \Appwrite\Models\Table */ public function getTable(string $databaseId, string $tableId): \Appwrite\Models\Table { @@ -1071,21 +958,12 @@ public function getTable(string $databaseId, string $tableId): \Appwrite\Models\ } return \Appwrite\Models\Table::from($response); - } /** * Update a table by its unique ID. * - * @param string $databaseId - * @param string $tableId - * @param ?string $name - * @param ?array $permissions - * @param ?bool $rowSecurity - * @param ?bool $enabled - * @param ?bool $purge * @throws AppwriteException - * @return \Appwrite\Models\Table */ public function updateTable(string $databaseId, string $tableId, ?string $name = null, ?array $permissions = null, ?bool $rowSecurity = null, ?bool $enabled = null, ?bool $purge = null): \Appwrite\Models\Table { @@ -1133,17 +1011,13 @@ public function updateTable(string $databaseId, string $tableId, ?string $name = } return \Appwrite\Models\Table::from($response); - } /** * Delete a table by its unique ID. Only users with write permissions have * access to delete this resource. * - * @param string $databaseId - * @param string $tableId * @throws AppwriteException - * @return string */ public function deleteTable(string $databaseId, string $tableId): string { @@ -1161,26 +1035,18 @@ public function deleteTable(string $databaseId, string $tableId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List columns in the table. * - * @param string $databaseId - * @param string $tableId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ColumnList */ public function listColumns(string $databaseId, string $tableId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\ColumnList { @@ -1218,24 +1084,13 @@ public function listColumns(string $databaseId, string $tableId, ?array $queries } return \Appwrite\Models\ColumnList::from($response); - } /** * Create a bigint column. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?int $min - * @param ?int $max - * @param ?int $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnBigint */ public function createBigIntColumn(string $databaseId, string $tableId, string $key, bool $required, ?int $min = null, ?int $max = null, ?int $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnBigint { @@ -1275,24 +1130,13 @@ public function createBigIntColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\ColumnBigint::from($response); - } /** * Update a bigint column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?int $xdefault - * @param ?int $min - * @param ?int $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnBigint */ public function updateBigIntColumn(string $databaseId, string $tableId, string $key, bool $required, ?int $xdefault, ?int $min = null, ?int $max = null, ?string $newKey = null): \Appwrite\Models\ColumnBigint { @@ -1329,21 +1173,12 @@ public function updateBigIntColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\ColumnBigint::from($response); - } /** * Create a boolean column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?bool $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnBoolean */ public function createBooleanColumn(string $databaseId, string $tableId, string $key, bool $required, ?bool $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnBoolean { @@ -1381,21 +1216,13 @@ public function createBooleanColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnBoolean::from($response); - } /** * Update a boolean column. Changing the `default` value will not update * already existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?bool $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnBoolean */ public function updateBooleanColumn(string $databaseId, string $tableId, string $key, bool $required, ?bool $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnBoolean { @@ -1430,20 +1257,12 @@ public function updateBooleanColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnBoolean::from($response); - } /** * Create a date time column according to the ISO 8601 standard. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnDatetime */ public function createDatetimeColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnDatetime { @@ -1481,21 +1300,13 @@ public function createDatetimeColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnDatetime::from($response); - } /** * Update a date time column. Changing the `default` value will not update * already existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnDatetime */ public function updateDatetimeColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnDatetime { @@ -1530,21 +1341,12 @@ public function updateDatetimeColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnDatetime::from($response); - } /** * Create an email column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnEmail */ public function createEmailColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnEmail { @@ -1582,22 +1384,13 @@ public function createEmailColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnEmail::from($response); - } /** * Update an email column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnEmail */ public function updateEmailColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnEmail { @@ -1632,22 +1425,13 @@ public function updateEmailColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnEmail::from($response); - } /** * Create an enumeration column. The `elements` param acts as a white-list of * accepted values for this column. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param array $elements - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnEnum */ public function createEnumColumn(string $databaseId, string $tableId, string $key, array $elements, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnEnum { @@ -1686,23 +1470,13 @@ public function createEnumColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnEnum::from($response); - } /** * Update an enum column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param array $elements - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnEnum */ public function updateEnumColumn(string $databaseId, string $tableId, string $key, array $elements, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnEnum { @@ -1738,24 +1512,13 @@ public function updateEnumColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnEnum::from($response); - } /** * Create a float column. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?float $min - * @param ?float $max - * @param ?float $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnFloat */ public function createFloatColumn(string $databaseId, string $tableId, string $key, bool $required, ?float $min = null, ?float $max = null, ?float $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnFloat { @@ -1795,24 +1558,13 @@ public function createFloatColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnFloat::from($response); - } /** * Update a float column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?float $xdefault - * @param ?float $min - * @param ?float $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnFloat */ public function updateFloatColumn(string $databaseId, string $tableId, string $key, bool $required, ?float $xdefault, ?float $min = null, ?float $max = null, ?string $newKey = null): \Appwrite\Models\ColumnFloat { @@ -1849,24 +1601,13 @@ public function updateFloatColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnFloat::from($response); - } /** * Create an integer column. Optionally, minimum and maximum values can be * provided. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?int $min - * @param ?int $max - * @param ?int $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnInteger */ public function createIntegerColumn(string $databaseId, string $tableId, string $key, bool $required, ?int $min = null, ?int $max = null, ?int $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnInteger { @@ -1906,24 +1647,13 @@ public function createIntegerColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnInteger::from($response); - } /** * Update an integer column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?int $xdefault - * @param ?int $min - * @param ?int $max - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnInteger */ public function updateIntegerColumn(string $databaseId, string $tableId, string $key, bool $required, ?int $xdefault, ?int $min = null, ?int $max = null, ?string $newKey = null): \Appwrite\Models\ColumnInteger { @@ -1960,21 +1690,12 @@ public function updateIntegerColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnInteger::from($response); - } /** * Create IP address column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnIp */ public function createIpColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnIp { @@ -2012,22 +1733,13 @@ public function createIpColumn(string $databaseId, string $tableId, string $key, } return \Appwrite\Models\ColumnIp::from($response); - } /** * Update an ip column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnIp */ public function updateIpColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnIp { @@ -2062,19 +1774,12 @@ public function updateIpColumn(string $databaseId, string $tableId, string $key, } return \Appwrite\Models\ColumnIp::from($response); - } /** * Create a geometric line column. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\ColumnLine */ public function createLineColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null): \Appwrite\Models\ColumnLine { @@ -2108,21 +1813,13 @@ public function createLineColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnLine::from($response); - } /** * Update a line column. Changing the `default` value will not update already * existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnLine */ public function updateLineColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null, ?string $newKey = null): \Appwrite\Models\ColumnLine { @@ -2157,22 +1854,12 @@ public function updateLineColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnLine::from($response); - } /** * Create a longtext column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnLongtext */ public function createLongtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\ColumnLongtext { @@ -2214,22 +1901,13 @@ public function createLongtextColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnLongtext::from($response); - } /** * Update a longtext column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnLongtext */ public function updateLongtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnLongtext { @@ -2264,22 +1942,12 @@ public function updateLongtextColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnLongtext::from($response); - } /** * Create a mediumtext column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnMediumtext */ public function createMediumtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\ColumnMediumtext { @@ -2321,22 +1989,13 @@ public function createMediumtextColumn(string $databaseId, string $tableId, stri } return \Appwrite\Models\ColumnMediumtext::from($response); - } /** * Update a mediumtext column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnMediumtext */ public function updateMediumtextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnMediumtext { @@ -2371,19 +2030,12 @@ public function updateMediumtextColumn(string $databaseId, string $tableId, stri } return \Appwrite\Models\ColumnMediumtext::from($response); - } /** * Create a geometric point column. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\ColumnPoint */ public function createPointColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null): \Appwrite\Models\ColumnPoint { @@ -2417,21 +2069,13 @@ public function createPointColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnPoint::from($response); - } /** * Update a point column. Changing the `default` value will not update already * existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnPoint */ public function updatePointColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null, ?string $newKey = null): \Appwrite\Models\ColumnPoint { @@ -2466,19 +2110,12 @@ public function updatePointColumn(string $databaseId, string $tableId, string $k } return \Appwrite\Models\ColumnPoint::from($response); - } /** * Create a geometric polygon column. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault * @throws AppwriteException - * @return \Appwrite\Models\ColumnPolygon */ public function createPolygonColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null): \Appwrite\Models\ColumnPolygon { @@ -2512,21 +2149,13 @@ public function createPolygonColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnPolygon::from($response); - } /** * Update a polygon column. Changing the `default` value will not update * already existing rows. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?array $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnPolygon */ public function updatePolygonColumn(string $databaseId, string $tableId, string $key, bool $required, ?array $xdefault = null, ?string $newKey = null): \Appwrite\Models\ColumnPolygon { @@ -2561,24 +2190,13 @@ public function updatePolygonColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnPolygon::from($response); - } /** * Create relationship column. [Learn more about relationship * columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - * * - * @param string $databaseId - * @param string $tableId - * @param string $relatedTableId - * @param RelationshipType $type - * @param ?bool $twoWay - * @param ?string $key - * @param ?string $twoWayKey - * @param ?RelationMutate $onDelete * @throws AppwriteException - * @return \Appwrite\Models\ColumnRelationship */ public function createRelationshipColumn(string $databaseId, string $tableId, string $relatedTableId, RelationshipType $type, ?bool $twoWay = null, ?string $key = null, ?string $twoWayKey = null, ?RelationMutate $onDelete = null): \Appwrite\Models\ColumnRelationship { @@ -2621,23 +2239,12 @@ public function createRelationshipColumn(string $databaseId, string $tableId, st } return \Appwrite\Models\ColumnRelationship::from($response); - } /** * Create a string column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param int $size - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnString * * @deprecated This API has been deprecated since 1.9.0. Please use `createTextColumn` instead. * @see TablesDB::createTextColumn @@ -2683,23 +2290,13 @@ public function createStringColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\ColumnString::from($response); - } /** * Update a string column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?int $size - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnString * * @deprecated This API has been deprecated since 1.8.0. Please use `updateTextColumn` instead. * @see TablesDB::updateTextColumn @@ -2738,22 +2335,12 @@ public function updateStringColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\ColumnString::from($response); - } /** * Create a text column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnText */ public function createTextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\ColumnText { @@ -2795,22 +2382,13 @@ public function createTextColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnText::from($response); - } /** * Update a text column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnText */ public function updateTextColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnText { @@ -2845,21 +2423,12 @@ public function updateTextColumn(string $databaseId, string $tableId, string $ke } return \Appwrite\Models\ColumnText::from($response); - } /** * Create a URL column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray * @throws AppwriteException - * @return \Appwrite\Models\ColumnUrl */ public function createUrlColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault = null, ?bool $xarray = null): \Appwrite\Models\ColumnUrl { @@ -2897,22 +2466,13 @@ public function createUrlColumn(string $databaseId, string $tableId, string $key } return \Appwrite\Models\ColumnUrl::from($response); - } /** * Update an url column. Changing the `default` value will not update already * existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnUrl */ public function updateUrlColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?string $newKey = null): \Appwrite\Models\ColumnUrl { @@ -2947,23 +2507,12 @@ public function updateUrlColumn(string $databaseId, string $tableId, string $key } return \Appwrite\Models\ColumnUrl::from($response); - } /** * Create a varchar column. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param int $size - * @param bool $required - * @param ?string $xdefault - * @param ?bool $xarray - * @param ?bool $encrypt * @throws AppwriteException - * @return \Appwrite\Models\ColumnVarchar */ public function createVarcharColumn(string $databaseId, string $tableId, string $key, int $size, bool $required, ?string $xdefault = null, ?bool $xarray = null, ?bool $encrypt = null): \Appwrite\Models\ColumnVarchar { @@ -3006,23 +2555,13 @@ public function createVarcharColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnVarchar::from($response); - } /** * Update a varchar column. Changing the `default` value will not update * already existing rows. - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param bool $required - * @param ?string $xdefault - * @param ?int $size - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnVarchar */ public function updateVarcharColumn(string $databaseId, string $tableId, string $key, bool $required, ?string $xdefault, ?int $size = null, ?string $newKey = null): \Appwrite\Models\ColumnVarchar { @@ -3058,17 +2597,12 @@ public function updateVarcharColumn(string $databaseId, string $tableId, string } return \Appwrite\Models\ColumnVarchar::from($response); - } /** * Get column by ID. * - * @param string $databaseId - * @param string $tableId - * @param string $key * @throws AppwriteException - * @return \Appwrite\Models\ColumnBoolean|\Appwrite\Models\ColumnInteger|\Appwrite\Models\ColumnFloat|\Appwrite\Models\ColumnEmail|\Appwrite\Models\ColumnEnum|\Appwrite\Models\ColumnUrl|\Appwrite\Models\ColumnIp|\Appwrite\Models\ColumnDatetime|\Appwrite\Models\ColumnRelationship|\Appwrite\Models\ColumnString */ public function getColumn(string $databaseId, string $tableId, string $key): \Appwrite\Models\ColumnBoolean|\Appwrite\Models\ColumnInteger|\Appwrite\Models\ColumnFloat|\Appwrite\Models\ColumnEmail|\Appwrite\Models\ColumnEnum|\Appwrite\Models\ColumnUrl|\Appwrite\Models\ColumnIp|\Appwrite\Models\ColumnDatetime|\Appwrite\Models\ColumnRelationship|\Appwrite\Models\ColumnString { @@ -3139,17 +2673,12 @@ public function getColumn(string $databaseId, string $tableId, string $key): \Ap } throw new \UnexpectedValueException('Unable to match response to any expected response model.'); - } /** * Deletes a column. * - * @param string $databaseId - * @param string $tableId - * @param string $key * @throws AppwriteException - * @return string */ public function deleteColumn(string $databaseId, string $tableId, string $key): string { @@ -3168,29 +2697,19 @@ public function deleteColumn(string $databaseId, string $tableId, string $key): $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update relationship column. [Learn more about relationship * columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - * * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param ?RelationMutate $onDelete - * @param ?string $newKey * @throws AppwriteException - * @return \Appwrite\Models\ColumnRelationship */ public function updateRelationshipColumn(string $databaseId, string $tableId, string $key, ?RelationMutate $onDelete = null, ?string $newKey = null): \Appwrite\Models\ColumnRelationship { @@ -3224,18 +2743,12 @@ public function updateRelationshipColumn(string $databaseId, string $tableId, st } return \Appwrite\Models\ColumnRelationship::from($response); - } /** * List indexes on the table. * - * @param string $databaseId - * @param string $tableId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\ColumnIndexList */ public function listIndexes(string $databaseId, string $tableId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\ColumnIndexList { @@ -3273,7 +2786,6 @@ public function listIndexes(string $databaseId, string $tableId, ?array $queries } return \Appwrite\Models\ColumnIndexList::from($response); - } /** @@ -3281,15 +2793,7 @@ public function listIndexes(string $databaseId, string $tableId, ?array $queries * columns you will query in a single request. * Type can be `key`, `fulltext`, or `unique`. * - * @param string $databaseId - * @param string $tableId - * @param string $key - * @param TablesDBIndexType $type - * @param array $columns - * @param ?array $orders - * @param ?array $lengths * @throws AppwriteException - * @return \Appwrite\Models\ColumnIndex */ public function createIndex(string $databaseId, string $tableId, string $key, TablesDBIndexType $type, array $columns, ?array $orders = null, ?array $lengths = null): \Appwrite\Models\ColumnIndex { @@ -3331,17 +2835,12 @@ public function createIndex(string $databaseId, string $tableId, string $key, Ta } return \Appwrite\Models\ColumnIndex::from($response); - } /** * Get index by ID. * - * @param string $databaseId - * @param string $tableId - * @param string $key * @throws AppwriteException - * @return \Appwrite\Models\ColumnIndex */ public function getIndex(string $databaseId, string $tableId, string $key): \Appwrite\Models\ColumnIndex { @@ -3372,17 +2871,12 @@ public function getIndex(string $databaseId, string $tableId, string $key): \App } return \Appwrite\Models\ColumnIndex::from($response); - } /** * Delete an index. * - * @param string $databaseId - * @param string $tableId - * @param string $key * @throws AppwriteException - * @return string */ public function deleteIndex(string $databaseId, string $tableId, string $key): string { @@ -3401,29 +2895,19 @@ public function deleteIndex(string $databaseId, string $tableId, string $key): s $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a list of all the user's rows in a given table. You can use the query * params to filter your results. * - * @param string $databaseId - * @param string $tableId - * @param ?array $queries - * @param ?string $transactionId - * @param ?bool $total - * @param ?int $ttl * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function listRows(string $databaseId, string $tableId, ?array $queries = null, ?string $transactionId = null, ?bool $total = null, ?int $ttl = null): \Appwrite\Models\RowList { @@ -3469,7 +2953,6 @@ public function listRows(string $databaseId, string $tableId, ?array $queries = } return \Appwrite\Models\RowList::from($response); - } /** @@ -3478,14 +2961,7 @@ public function listRows(string $databaseId, string $tableId, ?array $queries = * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function createRow(string $databaseId, string $tableId, string $rowId, array $data, ?array $permissions = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3520,7 +2996,6 @@ public function createRow(string $databaseId, string $tableId, string $rowId, ar } return \Appwrite\Models\Row::from($response); - } /** @@ -3529,12 +3004,7 @@ public function createRow(string $databaseId, string $tableId, string $rowId, ar * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. * - * @param string $databaseId - * @param string $tableId - * @param array $rows - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function createRows(string $databaseId, string $tableId, array $rows, ?string $transactionId = null): \Appwrite\Models\RowList { @@ -3567,7 +3037,6 @@ public function createRows(string $databaseId, string $tableId, array $rows, ?st } return \Appwrite\Models\RowList::from($response); - } /** @@ -3575,14 +3044,8 @@ public function createRows(string $databaseId, string $tableId, array $rows, ?st * table resource using either a [server * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. - * * - * @param string $databaseId - * @param string $tableId - * @param array $rows - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function upsertRows(string $databaseId, string $tableId, array $rows, ?string $transactionId = null): \Appwrite\Models\RowList { @@ -3615,20 +3078,13 @@ public function upsertRows(string $databaseId, string $tableId, array $rows, ?st } return \Appwrite\Models\RowList::from($response); - } /** * Update all rows that match your queries, if no queries are submitted then * all rows are updated. You can pass only specific fields to be updated. * - * @param string $databaseId - * @param string $tableId - * @param ?array $data - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function updateRows(string $databaseId, string $tableId, ?array $data = null, ?array $queries = null, ?string $transactionId = null): \Appwrite\Models\RowList { @@ -3668,19 +3124,13 @@ public function updateRows(string $databaseId, string $tableId, ?array $data = n } return \Appwrite\Models\RowList::from($response); - } /** * Bulk delete rows using queries, if no queries are passed then all rows are * deleted. * - * @param string $databaseId - * @param string $tableId - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\RowList */ public function deleteRows(string $databaseId, string $tableId, ?array $queries = null, ?string $transactionId = null): \Appwrite\Models\RowList { @@ -3719,20 +3169,13 @@ public function deleteRows(string $databaseId, string $tableId, ?array $queries } return \Appwrite\Models\RowList::from($response); - } /** * Get a row by its unique ID. This endpoint response returns a JSON object * with the row data. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param ?array $queries - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function getRow(string $databaseId, string $tableId, string $rowId, ?array $queries = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3771,7 +3214,6 @@ public function getRow(string $databaseId, string $tableId, string $rowId, ?arra } return \Appwrite\Models\Row::from($response); - } /** @@ -3780,14 +3222,7 @@ public function getRow(string $databaseId, string $tableId, string $rowId, ?arra * integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) * API or directly from your database console. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param ?array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function upsertRow(string $databaseId, string $tableId, string $rowId, ?array $data = null, ?array $permissions = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3825,21 +3260,13 @@ public function upsertRow(string $databaseId, string $tableId, string $rowId, ?a } return \Appwrite\Models\Row::from($response); - } /** * Update a row by its unique ID. Using the patch method you can pass only * specific fields that will get updated. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param ?array $data - * @param ?array $permissions - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function updateRow(string $databaseId, string $tableId, string $rowId, ?array $data = null, ?array $permissions = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3877,18 +3304,12 @@ public function updateRow(string $databaseId, string $tableId, string $rowId, ?a } return \Appwrite\Models\Row::from($response); - } /** * Delete a row by its unique ID. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param ?string $transactionId * @throws AppwriteException - * @return string */ public function deleteRow(string $databaseId, string $tableId, string $rowId, ?string $transactionId = null): string { @@ -3911,29 +3332,18 @@ public function deleteRow(string $databaseId, string $tableId, string $rowId, ?s $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Decrement a specific column of a row by a given value. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param string $column - * @param ?float $value - * @param ?float $min - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function decrementRowColumn(string $databaseId, string $tableId, string $rowId, string $column, ?float $value = null, ?float $min = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -3972,21 +3382,12 @@ public function decrementRowColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\Row::from($response); - } /** * Increment a specific column of a row by a given value. * - * @param string $databaseId - * @param string $tableId - * @param string $rowId - * @param string $column - * @param ?float $value - * @param ?float $max - * @param ?string $transactionId * @throws AppwriteException - * @return \Appwrite\Models\Row */ public function incrementRowColumn(string $databaseId, string $tableId, string $rowId, string $column, ?float $value = null, ?float $max = null, ?string $transactionId = null): \Appwrite\Models\Row { @@ -4025,6 +3426,5 @@ public function incrementRowColumn(string $databaseId, string $tableId, string $ } return \Appwrite\Models\Row::from($response); - } } diff --git a/src/Appwrite/Services/Teams.php b/src/Appwrite/Services/Teams.php index 53b32bcb..9796da0d 100644 --- a/src/Appwrite/Services/Teams.php +++ b/src/Appwrite/Services/Teams.php @@ -1,28 +1,20 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * List app installations on a team. Any team member can read installations. * - * @param string $teamId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\AppInstallationList */ public function listInstallations(string $teamId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\AppInstallationList { @@ -267,7 +237,6 @@ public function listInstallations(string $teamId, ?array $queries = null, ?bool } return \Appwrite\Models\AppInstallationList::from($response); - } /** @@ -276,11 +245,7 @@ public function listInstallations(string $teamId, ?array $queries = null, ?bool * mode can install apps on any team. The installation is granted the scopes * the app currently requests. * - * @param string $teamId - * @param string $appId - * @param ?string $authorizationDetails * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function createInstallation(string $teamId, string $appId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation { @@ -315,17 +280,13 @@ public function createInstallation(string $teamId, string $appId, ?string $autho } return \Appwrite\Models\AppInstallation::from($response); - } /** * Get an app installation on a team by its unique ID. Any team member can * read installations. * - * @param string $teamId - * @param string $installationId * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function getInstallation(string $teamId, string $installationId): \Appwrite\Models\AppInstallation { @@ -355,7 +316,6 @@ public function getInstallation(string $teamId, string $installationId): \Appwri } return \Appwrite\Models\AppInstallation::from($response); - } /** @@ -364,11 +324,7 @@ public function getInstallation(string $teamId, string $installationId): \Appwri * to the scopes the app currently requests; previously issued installation * access tokens are revoked. * - * @param string $teamId - * @param string $installationId - * @param ?string $authorizationDetails * @throws AppwriteException - * @return \Appwrite\Models\AppInstallation */ public function updateInstallation(string $teamId, string $installationId, ?string $authorizationDetails = null): \Appwrite\Models\AppInstallation { @@ -400,7 +356,6 @@ public function updateInstallation(string $teamId, string $installationId, ?stri } return \Appwrite\Models\AppInstallation::from($response); - } /** @@ -408,10 +363,7 @@ public function updateInstallation(string $teamId, string $installationId, ?stri * the owner role can remove installations. Previously issued installation * access tokens are revoked. * - * @param string $teamId - * @param string $installationId * @throws AppwriteException - * @return string */ public function deleteInstallation(string $teamId, string $installationId): string { @@ -430,15 +382,12 @@ public function deleteInstallation(string $teamId, string $installationId): stri $apiHeaders['content-type'] = 'application/json'; $apiHeaders['accept'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -446,12 +395,7 @@ public function deleteInstallation(string $teamId, string $installationId): stri * members have read access to this endpoint. Hide sensitive attributes from * the response by toggling membership privacy in the Console. * - * @param string $teamId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\MembershipList */ public function listMemberships(string $teamId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\MembershipList { @@ -492,7 +436,6 @@ public function listMemberships(string $teamId, ?array $queries = null, ?string } return \Appwrite\Models\MembershipList::from($response); - } /** @@ -502,31 +445,22 @@ public function listMemberships(string $teamId, ?array $queries = null, ?string * team to the invited user, and an account will be created for them if one * doesn't exist. If initiated from a Server SDK, the new member will be added * automatically to the team. - * + * * You only need to provide one of a user ID, email, or phone number. Appwrite * will prioritize accepting the user ID > email > phone number if you provide * more than one of these parameters. - * + * * Use the `url` parameter to redirect the user from the invitation email to * your app. After the user is redirected, use the [Update Team Membership * Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) - * endpoint to allow the user to accept the invitation to the team. - * + * endpoint to allow the user to accept the invitation to the team. + * * Please note that to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) * Appwrite will accept the only redirect URLs under the domains you have * added as a platform on the Appwrite Console. - * * - * @param string $teamId - * @param array $roles - * @param ?string $email - * @param ?string $userId - * @param ?string $phone - * @param ?string $url - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function createMembership(string $teamId, array $roles, ?string $email = null, ?string $userId = null, ?string $phone = null, ?string $url = null, ?string $name = null): \Appwrite\Models\Membership { @@ -577,7 +511,6 @@ public function createMembership(string $teamId, array $roles, ?string $email = } return \Appwrite\Models\Membership::from($response); - } /** @@ -585,10 +518,7 @@ public function createMembership(string $teamId, array $roles, ?string $email = * access for this resource. Hide sensitive attributes from the response by * toggling membership privacy in the Console. * - * @param string $teamId - * @param string $membershipId * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function getMembership(string $teamId, string $membershipId): \Appwrite\Models\Membership { @@ -618,20 +548,14 @@ public function getMembership(string $teamId, string $membershipId): \Appwrite\M } return \Appwrite\Models\Membership::from($response); - } /** * Modify the roles of a team member. Only team members with the owner role * have access to this endpoint. Learn more about [roles and * permissions](https://appwrite.io/docs/permissions). - * * - * @param string $teamId - * @param string $membershipId - * @param array $roles * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function updateMembership(string $teamId, string $membershipId, array $roles): \Appwrite\Models\Membership { @@ -663,7 +587,6 @@ public function updateMembership(string $teamId, string $membershipId, array $ro } return \Appwrite\Models\Membership::from($response); - } /** @@ -671,10 +594,7 @@ public function updateMembership(string $teamId, string $membershipId, array $ro * the membership of any other team member. You can also use this endpoint to * delete a user membership even if it is not accepted. * - * @param string $teamId - * @param string $membershipId * @throws AppwriteException - * @return string */ public function deleteMembership(string $teamId, string $membershipId): string { @@ -692,32 +612,23 @@ public function deleteMembership(string $teamId, string $membershipId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Use this endpoint to allow a user to accept an invitation to join a team * after being redirected back to your app from the invitation email received * by the user. - * + * * If the request is successful, a session for the user is automatically * created. - * * - * @param string $teamId - * @param string $membershipId - * @param string $userId - * @param string $secret * @throws AppwriteException - * @return \Appwrite\Models\Membership */ public function updateMembershipStatus(string $teamId, string $membershipId, string $userId, string $secret): \Appwrite\Models\Membership { @@ -750,7 +661,6 @@ public function updateMembershipStatus(string $teamId, string $membershipId, str } return \Appwrite\Models\Membership::from($response); - } /** @@ -758,9 +668,7 @@ public function updateMembershipStatus(string $teamId, string $membershipId, str * need to be shared by all team members, prefer storing them in [user * preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). * - * @param string $teamId * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function getPrefs(string $teamId): \Appwrite\Models\Preferences { @@ -789,7 +697,6 @@ public function getPrefs(string $teamId): \Appwrite\Models\Preferences } return \Appwrite\Models\Preferences::from($response); - } /** @@ -797,10 +704,7 @@ public function getPrefs(string $teamId): \Appwrite\Models\Preferences * stored as is and replaces any previous value. The maximum allowed prefs * size is 64kB and throws an error if exceeded. * - * @param string $teamId - * @param array $prefs * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function updatePrefs(string $teamId, array $prefs): \Appwrite\Models\Preferences { @@ -831,6 +735,5 @@ public function updatePrefs(string $teamId, array $prefs): \Appwrite\Models\Pref } return \Appwrite\Models\Preferences::from($response); - } } diff --git a/src/Appwrite/Services/Tokens.php b/src/Appwrite/Services/Tokens.php index 54066ff4..1d2b5137 100644 --- a/src/Appwrite/Services/Tokens.php +++ b/src/Appwrite/Services/Tokens.php @@ -1,29 +1,20 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } } diff --git a/src/Appwrite/Services/Users.php b/src/Appwrite/Services/Users.php index a7ee2eda..33754118 100644 --- a/src/Appwrite/Services/Users.php +++ b/src/Appwrite/Services/Users.php @@ -1,31 +1,23 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -309,12 +271,7 @@ public function deleteIdentity(string $identityId): string * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createMD5User(string $userId, string $email, string $password, ?string $name = null): \Appwrite\Models\User { @@ -350,7 +307,6 @@ public function createMD5User(string $userId, string $email, string $password, ? } return \Appwrite\Models\User::from($response); - } /** @@ -359,12 +315,7 @@ public function createMD5User(string $userId, string $email, string $password, ? * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createPHPassUser(string $userId, string $email, string $password, ?string $name = null): \Appwrite\Models\User { @@ -400,7 +351,6 @@ public function createPHPassUser(string $userId, string $email, string $password } return \Appwrite\Models\User::from($response); - } /** @@ -409,17 +359,7 @@ public function createPHPassUser(string $userId, string $email, string $password * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param string $passwordSalt - * @param int $passwordCpu - * @param int $passwordMemory - * @param int $passwordParallel - * @param int $passwordLength - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createScryptUser(string $userId, string $email, string $password, string $passwordSalt, int $passwordCpu, int $passwordMemory, int $passwordParallel, int $passwordLength, ?string $name = null): \Appwrite\Models\User { @@ -460,7 +400,6 @@ public function createScryptUser(string $userId, string $email, string $password } return \Appwrite\Models\User::from($response); - } /** @@ -470,15 +409,7 @@ public function createScryptUser(string $userId, string $email, string $password * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param string $passwordSalt - * @param string $passwordSaltSeparator - * @param string $passwordSignerKey - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createScryptModifiedUser(string $userId, string $email, string $password, string $passwordSalt, string $passwordSaltSeparator, string $passwordSignerKey, ?string $name = null): \Appwrite\Models\User { @@ -517,7 +448,6 @@ public function createScryptModifiedUser(string $userId, string $email, string $ } return \Appwrite\Models\User::from($response); - } /** @@ -526,13 +456,7 @@ public function createScryptModifiedUser(string $userId, string $email, string $ * the [POST /users](https://appwrite.io/docs/server/users#usersCreate) * endpoint to create users with a plain text password. * - * @param string $userId - * @param string $email - * @param string $password - * @param ?PasswordHash $passwordVersion - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function createSHAUser(string $userId, string $email, string $password, ?PasswordHash $passwordVersion = null, ?string $name = null): \Appwrite\Models\User { @@ -572,15 +496,12 @@ public function createSHAUser(string $userId, string $email, string $password, ? } return \Appwrite\Models\User::from($response); - } /** * Get a user by its unique ID. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\User */ public function get(string $userId): \Appwrite\Models\User { @@ -609,7 +530,6 @@ public function get(string $userId): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** @@ -620,9 +540,7 @@ public function get(string $userId): \Appwrite\Models\User * [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) * endpoint instead. * - * @param string $userId * @throws AppwriteException - * @return string */ public function delete(string $userId): string { @@ -639,24 +557,18 @@ public function delete(string $userId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the user email by its unique ID. * - * @param string $userId - * @param string $email * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateEmail(string $userId, string $email): \Appwrite\Models\User { @@ -687,7 +599,6 @@ public function updateEmail(string $userId, string $email): \Appwrite\Models\Use } return \Appwrite\Models\User::from($response); - } /** @@ -696,12 +607,8 @@ public function updateEmail(string $userId, string $email): \Appwrite\Models\Use * behavior, while internal audit logs still attribute the action to the * original impersonator and store the impersonated target details only in * internal audit payload data. - * * - * @param string $userId - * @param bool $impersonator * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateImpersonator(string $userId, bool $impersonator): \Appwrite\Models\User { @@ -732,7 +639,6 @@ public function updateImpersonator(string $userId, bool $impersonator): \Appwrit } return \Appwrite\Models\User::from($response); - } /** @@ -740,11 +646,7 @@ public function updateImpersonator(string $userId, bool $impersonator): \Appwrit * can use the resulting JWT to authenticate on behalf of the user. The JWT * secret will become invalid if the session it uses gets deleted. * - * @param string $userId - * @param ?string $sessionId - * @param ?int $duration * @throws AppwriteException - * @return \Appwrite\Models\Jwt */ public function createJWT(string $userId, ?string $sessionId = null, ?int $duration = null): \Appwrite\Models\Jwt { @@ -782,21 +684,17 @@ public function createJWT(string $userId, ?string $sessionId = null, ?int $durat } return \Appwrite\Models\Jwt::from($response); - } /** - * Update the user labels by its unique ID. - * + * Update the user labels by its unique ID. + * * Labels can be used to grant access to resources. While teams are a way for * user's to share access to a resource, labels can be defined by the * developer to grant access without an invitation. See the [Permissions * docs](https://appwrite.io/docs/permissions) for more info. * - * @param string $userId - * @param array $labels * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateLabels(string $userId, array $labels): \Appwrite\Models\User { @@ -827,17 +725,12 @@ public function updateLabels(string $userId, array $labels): \Appwrite\Models\Us } return \Appwrite\Models\User::from($response); - } /** * Get the user activity logs list by its unique ID. * - * @param string $userId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\LogList */ public function listLogs(string $userId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\LogList { @@ -874,18 +767,12 @@ public function listLogs(string $userId, ?array $queries = null, ?bool $total = } return \Appwrite\Models\LogList::from($response); - } /** * Get the user membership list by its unique ID. * - * @param string $userId - * @param ?array $queries - * @param ?string $search - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\MembershipList */ public function listMemberships(string $userId, ?array $queries = null, ?string $search = null, ?bool $total = null): \Appwrite\Models\MembershipList { @@ -926,16 +813,12 @@ public function listMemberships(string $userId, ?array $queries = null, ?string } return \Appwrite\Models\MembershipList::from($response); - } /** * Enable or disable MFA on a user account. * - * @param string $userId - * @param bool $mfa * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateMFA(string $userId, bool $mfa): \Appwrite\Models\User { @@ -966,22 +849,18 @@ public function updateMFA(string $userId, bool $mfa): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** * Delete an authenticator app. * - * @param string $userId - * @param AuthenticatorType $type * @throws AppwriteException - * @return string */ public function deleteMFAAuthenticator(string $userId, AuthenticatorType $type): string { $apiPath = str_replace( ['{userId}', '{type}'], - [$userId, $type], + [$userId, (string) $type], '/users/{userId}/mfa/authenticators/{type}' ); @@ -993,25 +872,19 @@ public function deleteMFAAuthenticator(string $userId, AuthenticatorType $type): $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Get a custom MFA challenge for a user, including the code to be delivered * through your own channel. * - * @param string $userId - * @param string $challengeId * @throws AppwriteException - * @return \Appwrite\Models\MfaChallengeSecret */ public function getMFAChallenge(string $userId, string $challengeId): \Appwrite\Models\MfaChallengeSecret { @@ -1041,15 +914,12 @@ public function getMFAChallenge(string $userId, string $challengeId): \Appwrite\ } return \Appwrite\Models\MfaChallengeSecret::from($response); - } /** * List the factors available on the account to be used as a MFA challange. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\MfaFactors */ public function listMFAFactors(string $userId): \Appwrite\Models\MfaFactors { @@ -1078,7 +948,6 @@ public function listMFAFactors(string $userId): \Appwrite\Models\MfaFactors } return \Appwrite\Models\MfaFactors::from($response); - } /** @@ -1087,9 +956,7 @@ public function listMFAFactors(string $userId): \Appwrite\Models\MfaFactors * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) * method. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function getMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecoveryCodes { @@ -1118,7 +985,6 @@ public function getMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecover } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** @@ -1127,9 +993,7 @@ public function getMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecover * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) * method. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function updateMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecoveryCodes { @@ -1159,7 +1023,6 @@ public function updateMFARecoveryCodes(string $userId): \Appwrite\Models\MfaReco } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** @@ -1168,9 +1031,7 @@ public function updateMFARecoveryCodes(string $userId): \Appwrite\Models\MfaReco * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) * method by client SDK. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\MfaRecoveryCodes */ public function createMFARecoveryCodes(string $userId): \Appwrite\Models\MfaRecoveryCodes { @@ -1200,16 +1061,12 @@ public function createMFARecoveryCodes(string $userId): \Appwrite\Models\MfaReco } return \Appwrite\Models\MfaRecoveryCodes::from($response); - } /** * Update the user name by its unique ID. * - * @param string $userId - * @param string $name * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateName(string $userId, string $name): \Appwrite\Models\User { @@ -1240,16 +1097,12 @@ public function updateName(string $userId, string $name): \Appwrite\Models\User } return \Appwrite\Models\User::from($response); - } /** * Update the user password by its unique ID. * - * @param string $userId - * @param string $password * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePassword(string $userId, string $password): \Appwrite\Models\User { @@ -1280,16 +1133,12 @@ public function updatePassword(string $userId, string $password): \Appwrite\Mode } return \Appwrite\Models\User::from($response); - } /** * Update the user phone by its unique ID. * - * @param string $userId - * @param string $number * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePhone(string $userId, string $number): \Appwrite\Models\User { @@ -1320,15 +1169,12 @@ public function updatePhone(string $userId, string $number): \Appwrite\Models\Us } return \Appwrite\Models\User::from($response); - } /** * Get the user preferences by its unique ID. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function getPrefs(string $userId): \Appwrite\Models\Preferences { @@ -1357,7 +1203,6 @@ public function getPrefs(string $userId): \Appwrite\Models\Preferences } return \Appwrite\Models\Preferences::from($response); - } /** @@ -1365,10 +1210,7 @@ public function getPrefs(string $userId): \Appwrite\Models\Preferences * as is, and replaces any previous value. The maximum allowed prefs size is * 64kB and throws error if exceeded. * - * @param string $userId - * @param array $prefs * @throws AppwriteException - * @return \Appwrite\Models\Preferences */ public function updatePrefs(string $userId, array $prefs): \Appwrite\Models\Preferences { @@ -1399,16 +1241,12 @@ public function updatePrefs(string $userId, array $prefs): \Appwrite\Models\Pref } return \Appwrite\Models\Preferences::from($response); - } /** * Get the user sessions list by its unique ID. * - * @param string $userId - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\SessionList */ public function listSessions(string $userId, ?bool $total = null): \Appwrite\Models\SessionList { @@ -1441,20 +1279,17 @@ public function listSessions(string $userId, ?bool $total = null): \Appwrite\Mod } return \Appwrite\Models\SessionList::from($response); - } /** * Creates a session for a user. Returns an immediately usable session object. - * + * * If you want to generate a token for a custom authentication flow, use the * [POST * /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) * endpoint. * - * @param string $userId * @throws AppwriteException - * @return \Appwrite\Models\Session */ public function createSession(string $userId): \Appwrite\Models\Session { @@ -1484,15 +1319,12 @@ public function createSession(string $userId): \Appwrite\Models\Session } return \Appwrite\Models\Session::from($response); - } /** * Delete all user's sessions by using the user's unique ID. * - * @param string $userId * @throws AppwriteException - * @return string */ public function deleteSessions(string $userId): string { @@ -1509,24 +1341,18 @@ public function deleteSessions(string $userId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Delete a user sessions by its unique ID. * - * @param string $userId - * @param string $sessionId * @throws AppwriteException - * @return string */ public function deleteSession(string $userId, string $sessionId): string { @@ -1544,25 +1370,19 @@ public function deleteSession(string $userId, string $sessionId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** * Update the user status by its unique ID. Use this endpoint as an * alternative to deleting a user if you want to keep user's ID reserved. * - * @param string $userId - * @param bool $status * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateStatus(string $userId, bool $status): \Appwrite\Models\User { @@ -1593,17 +1413,12 @@ public function updateStatus(string $userId, bool $status): \Appwrite\Models\Use } return \Appwrite\Models\User::from($response); - } /** * List the messaging targets that are associated with a user. * - * @param string $userId - * @param ?array $queries - * @param ?bool $total * @throws AppwriteException - * @return \Appwrite\Models\TargetList */ public function listTargets(string $userId, ?array $queries = null, ?bool $total = null): \Appwrite\Models\TargetList { @@ -1640,20 +1455,12 @@ public function listTargets(string $userId, ?array $queries = null, ?bool $total } return \Appwrite\Models\TargetList::from($response); - } /** * Create a messaging target. * - * @param string $userId - * @param string $targetId - * @param MessagingProviderType $providerType - * @param string $identifier - * @param ?string $providerId - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\Target */ public function createTarget(string $userId, string $targetId, MessagingProviderType $providerType, string $identifier, ?string $providerId = null, ?string $name = null): \Appwrite\Models\Target { @@ -1694,16 +1501,12 @@ public function createTarget(string $userId, string $targetId, MessagingProvider } return \Appwrite\Models\Target::from($response); - } /** * Get a user's push notification target by ID. * - * @param string $userId - * @param string $targetId * @throws AppwriteException - * @return \Appwrite\Models\Target */ public function getTarget(string $userId, string $targetId): \Appwrite\Models\Target { @@ -1733,19 +1536,12 @@ public function getTarget(string $userId, string $targetId): \Appwrite\Models\Ta } return \Appwrite\Models\Target::from($response); - } /** * Update a messaging target. * - * @param string $userId - * @param string $targetId - * @param ?string $identifier - * @param ?string $providerId - * @param ?string $name * @throws AppwriteException - * @return \Appwrite\Models\Target */ public function updateTarget(string $userId, string $targetId, ?string $identifier = null, ?string $providerId = null, ?string $name = null): \Appwrite\Models\Target { @@ -1788,16 +1584,12 @@ public function updateTarget(string $userId, string $targetId, ?string $identifi } return \Appwrite\Models\Target::from($response); - } /** * Delete a messaging target. * - * @param string $userId - * @param string $targetId * @throws AppwriteException - * @return string */ public function deleteTarget(string $userId, string $targetId): string { @@ -1815,15 +1607,12 @@ public function deleteTarget(string $userId, string $targetId): string $apiHeaders['X-Appwrite-Project'] = $this->client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -1831,13 +1620,8 @@ public function deleteTarget(string $userId, string $targetId): string * and secret and submit a request to the [PUT * /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) * endpoint to complete the login process. - * * - * @param string $userId - * @param ?int $length - * @param ?int $expire * @throws AppwriteException - * @return \Appwrite\Models\Token */ public function createToken(string $userId, ?int $length = null, ?int $expire = null): \Appwrite\Models\Token { @@ -1875,16 +1659,12 @@ public function createToken(string $userId, ?int $length = null, ?int $expire = } return \Appwrite\Models\Token::from($response); - } /** * Update the user email verification status by its unique ID. * - * @param string $userId - * @param bool $emailVerification * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updateEmailVerification(string $userId, bool $emailVerification): \Appwrite\Models\User { @@ -1915,16 +1695,12 @@ public function updateEmailVerification(string $userId, bool $emailVerification) } return \Appwrite\Models\User::from($response); - } /** * Update the user phone verification status by its unique ID. * - * @param string $userId - * @param bool $phoneVerification * @throws AppwriteException - * @return \Appwrite\Models\User */ public function updatePhoneVerification(string $userId, bool $phoneVerification): \Appwrite\Models\User { @@ -1955,6 +1731,5 @@ public function updatePhoneVerification(string $userId, bool $phoneVerification) } return \Appwrite\Models\User::from($response); - } } diff --git a/src/Appwrite/Services/Webhooks.php b/src/Appwrite/Services/Webhooks.php index 65e6fd18..2694980a 100644 --- a/src/Appwrite/Services/Webhooks.php +++ b/src/Appwrite/Services/Webhooks.php @@ -1,27 +1,20 @@ client->getConfig('project'); $apiHeaders['content-type'] = 'application/json'; - $response = $this->client->call( + return $this->client->call( Client::METHOD_DELETE, $apiPath, $apiHeaders, $apiParams ); - - return $response; - } /** @@ -269,10 +232,7 @@ public function delete(string $webhookId): string * signing key used to sign and validate payload deliveries for a specific * webhook. * - * @param string $webhookId - * @param ?string $secret * @throws AppwriteException - * @return \Appwrite\Models\Webhook */ public function updateSecret(string $webhookId, ?string $secret = null): \Appwrite\Models\Webhook { @@ -303,6 +263,5 @@ public function updateSecret(string $webhookId, ?string $secret = null): \Appwri } return \Appwrite\Models\Webhook::from($response); - } } diff --git a/tests/Appwrite/ClientTest.php b/tests/Appwrite/ClientTest.php new file mode 100644 index 00000000..69896e7c --- /dev/null +++ b/tests/Appwrite/ClientTest.php @@ -0,0 +1,194 @@ +expectException(AppwriteException::class); + $this->expectExceptionMessage('Invalid endpoint URL: invalid-endpoint'); + + $client = new Client(); + $client->setEndpoint('invalid-endpoint'); + } + + public function testSetEndpointWithoutProtocolThrowsException(): void + { + $this->expectException(AppwriteException::class); + $this->expectExceptionMessage('Invalid endpoint URL: example.com'); + + $client = new Client(); + $client->setEndpoint('example.com'); + } + + public function testChaining(): void + { + $client = new Client(); + $result = $client + ->setEndpoint('https://example.com') + ->setSelfSigned(true) + ->addHeader('X-Test', 'test'); + + $this->assertInstanceOf(Client::class, $result); + } + + public function testSetEndpointReturnsClient(): void + { + $client = new Client(); + $result = $client->setEndpoint('https://example.com'); + $this->assertSame($client, $result); + } + + public function testSetSelfSignedReturnsClient(): void + { + $client = new Client(); + $result = $client->setSelfSigned(true); + $this->assertSame($client, $result); + } + + public function testAddHeaderReturnsClient(): void + { + $client = new Client(); + $result = $client->addHeader('X-Custom', 'value'); + $this->assertSame($client, $result); + } + + public function testSetProjectReturnsClient(): void + { + $client = new Client(); + $result = $client->setProject('test-value'); + $this->assertSame($client, $result); + } + + public function testSetKeyReturnsClient(): void + { + $client = new Client(); + $result = $client->setKey('test-value'); + $this->assertSame($client, $result); + } + + public function testSetOrganizationReturnsClient(): void + { + $client = new Client(); + $result = $client->setOrganization('test-value'); + $this->assertSame($client, $result); + } + + public function testSetJWTReturnsClient(): void + { + $client = new Client(); + $result = $client->setJWT('test-value'); + $this->assertSame($client, $result); + } + + public function testSetBearerReturnsClient(): void + { + $client = new Client(); + $result = $client->setBearer('test-value'); + $this->assertSame($client, $result); + } + + public function testSetLocaleReturnsClient(): void + { + $client = new Client(); + $result = $client->setLocale('test-value'); + $this->assertSame($client, $result); + } + + public function testSetSessionReturnsClient(): void + { + $client = new Client(); + $result = $client->setSession('test-value'); + $this->assertSame($client, $result); + } + + public function testSetForwardedUserAgentReturnsClient(): void + { + $client = new Client(); + $result = $client->setForwardedUserAgent('test-value'); + $this->assertSame($client, $result); + } + + public function testSetDevKeyReturnsClient(): void + { + $client = new Client(); + $result = $client->setDevKey('test-value'); + $this->assertSame($client, $result); + } + + public function testSetCookieReturnsClient(): void + { + $client = new Client(); + $result = $client->setCookie('test-value'); + $this->assertSame($client, $result); + } + + public function testSetImpersonateUserIdReturnsClient(): void + { + $client = new Client(); + $result = $client->setImpersonateUserId('test-value'); + $this->assertSame($client, $result); + } + + public function testSetImpersonateUserEmailReturnsClient(): void + { + $client = new Client(); + $result = $client->setImpersonateUserEmail('test-value'); + $this->assertSame($client, $result); + } + + public function testSetImpersonateUserPhoneReturnsClient(): void + { + $client = new Client(); + $result = $client->setImpersonateUserPhone('test-value'); + $this->assertSame($client, $result); + } + + public function testHttpClientIsReusedUntilTransportOptionsChange(): void + { + $client = new Client(); + $client->setEndpoint('https://example.com/v1'); + + $first = $this->httpClient($client, true); + $this->assertInstanceOf(HttpClient::class, $first); + $this->assertSame($first, $this->httpClient($client, true)); + + $noRedirect = $this->httpClient($client, false); + $this->assertInstanceOf(HttpClient::class, $noRedirect); + $this->assertNotSame($first, $noRedirect); + + $client->setTimeout(5); + $this->assertNull(new ReflectionProperty(Client::class, 'httpClient')->getValue($client)); + $rebuilt = $this->httpClient($client, true); + $this->assertInstanceOf(HttpClient::class, $rebuilt); + $this->assertNotSame($first, $rebuilt); + } + + public function testSelfSignedAndConnectTimeoutResetHttpClient(): void + { + $client = new Client(); + $original = $this->httpClient($client, true); + + $client->setSelfSigned(true); + $this->assertNotSame($original, $this->httpClient($client, true)); + + $afterSelfSigned = $this->httpClient($client, true); + $client->setConnectTimeout(2); + $this->assertNotSame($afterSelfSigned, $this->httpClient($client, true)); + } + + private function httpClient(Client $client, bool $followRedirects): HttpClient + { + $method = new ReflectionMethod(Client::class, 'getHttpClient'); + + return $method->invoke($client, $followRedirects); + } +} diff --git a/tests/Appwrite/IDTest.php b/tests/Appwrite/IDTest.php index b12e8170..79694dfb 100644 --- a/tests/Appwrite/IDTest.php +++ b/tests/Appwrite/IDTest.php @@ -1,16 +1,21 @@ assertSame(20, strlen($id)); } - public function testCustom(): void { + public function testCustom(): void + { $this->assertSame('custom', ID::custom('custom')); } } diff --git a/tests/Appwrite/OperatorTest.php b/tests/Appwrite/OperatorTest.php index d1533483..b0bbb38f 100644 --- a/tests/Appwrite/OperatorTest.php +++ b/tests/Appwrite/OperatorTest.php @@ -1,92 +1,115 @@ assertSame('{"method":"increment","values":[1]}', Operator::increment()); $this->assertSame('{"method":"increment","values":[5,100]}', Operator::increment(5, 100)); } - public function testDecrement(): void { + public function testDecrement(): void + { $this->assertSame('{"method":"decrement","values":[1]}', Operator::decrement()); $this->assertSame('{"method":"decrement","values":[3,0]}', Operator::decrement(3, 0)); } - public function testMultiply(): void { + public function testMultiply(): void + { $this->assertSame('{"method":"multiply","values":[2]}', Operator::multiply(2)); $this->assertSame('{"method":"multiply","values":[3,1000]}', Operator::multiply(3, 1000)); } - public function testDivide(): void { + public function testDivide(): void + { $this->assertSame('{"method":"divide","values":[2]}', Operator::divide(2)); $this->assertSame('{"method":"divide","values":[4,1]}', Operator::divide(4, 1)); } - public function testModulo(): void { + public function testModulo(): void + { $this->assertSame('{"method":"modulo","values":[5]}', Operator::modulo(5)); } - public function testPower(): void { + public function testPower(): void + { $this->assertSame('{"method":"power","values":[2]}', Operator::power(2)); $this->assertSame('{"method":"power","values":[3,100]}', Operator::power(3, 100)); } - public function testArrayAppend(): void { + public function testArrayAppend(): void + { $this->assertSame('{"method":"arrayAppend","values":["item1","item2"]}', Operator::arrayAppend(['item1', 'item2'])); } - public function testArrayPrepend(): void { + public function testArrayPrepend(): void + { $this->assertSame('{"method":"arrayPrepend","values":["first","second"]}', Operator::arrayPrepend(['first', 'second'])); } - public function testArrayInsert(): void { + public function testArrayInsert(): void + { $this->assertSame('{"method":"arrayInsert","values":[0,"newItem"]}', Operator::arrayInsert(0, 'newItem')); } - public function testArrayRemove(): void { + public function testArrayRemove(): void + { $this->assertSame('{"method":"arrayRemove","values":["oldItem"]}', Operator::arrayRemove('oldItem')); } - public function testArrayUnique(): void { + public function testArrayUnique(): void + { $this->assertSame('{"method":"arrayUnique","values":[]}', Operator::arrayUnique()); } - public function testArrayIntersect(): void { + public function testArrayIntersect(): void + { $this->assertSame('{"method":"arrayIntersect","values":["a","b","c"]}', Operator::arrayIntersect(['a', 'b', 'c'])); } - public function testArrayDiff(): void { + public function testArrayDiff(): void + { $this->assertSame('{"method":"arrayDiff","values":["x","y"]}', Operator::arrayDiff(['x', 'y'])); } - public function testArrayFilter(): void { + public function testArrayFilter(): void + { $this->assertSame('{"method":"arrayFilter","values":["equal","test"]}', Operator::arrayFilter(Condition::Equal, 'test')); } - public function testStringConcat(): void { + public function testStringConcat(): void + { $this->assertSame('{"method":"stringConcat","values":["suffix"]}', Operator::stringConcat('suffix')); } - public function testStringReplace(): void { + public function testStringReplace(): void + { $this->assertSame('{"method":"stringReplace","values":["old","new"]}', Operator::stringReplace('old', 'new')); } - public function testToggle(): void { + public function testToggle(): void + { $this->assertSame('{"method":"toggle","values":[]}', Operator::toggle()); } - public function testDateAddDays(): void { + public function testDateAddDays(): void + { $this->assertSame('{"method":"dateAddDays","values":[7]}', Operator::dateAddDays(7)); } - public function testDateSubDays(): void { + public function testDateSubDays(): void + { $this->assertSame('{"method":"dateSubDays","values":[3]}', Operator::dateSubDays(3)); } - public function testDateSetNow(): void { + public function testDateSetNow(): void + { $this->assertSame('{"method":"dateSetNow","values":[]}', Operator::dateSetNow()); } } diff --git a/tests/Appwrite/PermissionTest.php b/tests/Appwrite/PermissionTest.php index b17958df..26af2fae 100644 --- a/tests/Appwrite/PermissionTest.php +++ b/tests/Appwrite/PermissionTest.php @@ -1,27 +1,35 @@ assertSame('read("any")', Permission::read(Role::any())); } - public function testWrite(): void { + public function testWrite(): void + { $this->assertSame('write("any")', Permission::write(Role::any())); } - public function testCreate(): void { + public function testCreate(): void + { $this->assertSame('create("any")', Permission::create(Role::any())); } - public function testUpdate(): void { + public function testUpdate(): void + { $this->assertSame('update("any")', Permission::update(Role::any())); } - public function testDelete(): void { + public function testDelete(): void + { $this->assertSame('delete("any")', Permission::delete(Role::any())); } } diff --git a/tests/Appwrite/QueryTest.php b/tests/Appwrite/QueryTest.php index bd7de62a..d25e1910 100644 --- a/tests/Appwrite/QueryTest.php +++ b/tests/Appwrite/QueryTest.php @@ -1,42 +1,44 @@ description = $description; - $this->value = $value; - $this->expectedValues = $expectedValues; +final class BasicFilterQueryTest +{ + public function __construct( + public string $description, + public mixed $value, + public string $expectedValues, + ) { } } -final class QueryTest extends TestCase { +final class QueryTest extends TestCase +{ /** * @var BasicFilterQueryTest[] $tests */ - private $tests; + private array $tests; protected function setUp(): void { parent::setUp(); - $this->tests = array( + $this->tests = [ new BasicFilterQueryTest('with a string', 's', '["s"]'), new BasicFilterQueryTest('with a integer', 1, '[1]'), new BasicFilterQueryTest('with a double', 1.2, '[1.2]'), new BasicFilterQueryTest('with a whole number double', 1.0, '[1]'), new BasicFilterQueryTest('with a bool', false, '[false]'), new BasicFilterQueryTest('with a list', ['a', 'b', 'c'], '["a","b","c"]'), - ); + ]; } - public function testBasicFilterEqual(): void { - foreach($this->tests as $test) { + public function testBasicFilterEqual(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::equal('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -45,8 +47,9 @@ public function testBasicFilterEqual(): void { } } - public function testBasicFilterNotEqual(): void { - foreach($this->tests as $test) { + public function testBasicFilterNotEqual(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::notEqual('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -55,8 +58,9 @@ public function testBasicFilterNotEqual(): void { } } - public function testBasicFilterLessThan(): void { - foreach($this->tests as $test) { + public function testBasicFilterLessThan(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::lessThan('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -65,8 +69,9 @@ public function testBasicFilterLessThan(): void { } } - public function testBasicFilterLessThanEqual(): void { - foreach($this->tests as $test) { + public function testBasicFilterLessThanEqual(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::lessThanEqual('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -75,8 +80,9 @@ public function testBasicFilterLessThanEqual(): void { } } - public function testBasicFilterGreaterThan(): void { - foreach($this->tests as $test) { + public function testBasicFilterGreaterThan(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::greaterThan('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -85,8 +91,9 @@ public function testBasicFilterGreaterThan(): void { } } - public function testBasicFilterGreaterThanEqual(): void { - foreach($this->tests as $test) { + public function testBasicFilterGreaterThanEqual(): void + { + foreach ($this->tests as $test) { $query = json_decode(Query::greaterThanEqual('attr', $test->value), true); $expected = json_decode($test->expectedValues, true); $this->assertSame('attr', $query['attribute'], $test->description); @@ -95,175 +102,200 @@ public function testBasicFilterGreaterThanEqual(): void { } } - public function testSearch(): void { + public function testSearch(): void + { $query = json_decode(Query::search('attr', 'keyword1 keyword2'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['keyword1 keyword2'], $query['values']); $this->assertSame('search', $query['method']); } - public function testIsNull(): void { + public function testIsNull(): void + { $query = json_decode(Query::isNull('attr'), true); $this->assertSame('attr', $query['attribute']); $this->assertNull($query['values'] ?? null); $this->assertSame('isNull', $query['method']); } - public function testIsNotNull(): void { + public function testIsNotNull(): void + { $query = json_decode(Query::isNotNull('attr'), true); $this->assertSame('attr', $query['attribute']); $this->assertNull($query['values'] ?? null); $this->assertSame('isNotNull', $query['method']); } - public function testBetweenWithIntegers(): void { + public function testBetweenWithIntegers(): void + { $query = json_decode(Query::between('attr', 1, 2), true); $this->assertSame('attr', $query['attribute']); $this->assertSame([1, 2], $query['values']); $this->assertSame('between', $query['method']); } - public function testBetweenWithDoubles(): void { + public function testBetweenWithDoubles(): void + { $query = json_decode(Query::between('attr', 1.0, 2.0), true); $this->assertSame('attr', $query['attribute']); $this->assertSame([1, 2], $query['values']); $this->assertSame('between', $query['method']); } - public function testBetweenWithStrings(): void { + public function testBetweenWithStrings(): void + { $query = json_decode(Query::between('attr', 'a', 'z'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['a', 'z'], $query['values']); $this->assertSame('between', $query['method']); } - public function testSelect(): void { + public function testSelect(): void + { $query = json_decode(Query::select(['attr1', 'attr2']), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr1', 'attr2'], $query['values']); $this->assertSame('select', $query['method']); } - public function testOrderAsc(): void { + public function testOrderAsc(): void + { $query = json_decode(Query::orderAsc('attr'), true); $this->assertSame('attr', $query['attribute']); $this->assertNull($query['values'] ?? null); $this->assertSame('orderAsc', $query['method']); } - public function testOrderDesc(): void { + public function testOrderDesc(): void + { $query = json_decode(Query::orderDesc('attr'), true); $this->assertSame('attr', $query['attribute']); $this->assertNull($query['values'] ?? null); $this->assertSame('orderDesc', $query['method']); } - public function testOrderRandom(): void { + public function testOrderRandom(): void + { $query = json_decode(Query::orderRandom(), true); $this->assertNull($query['attribute'] ?? null); $this->assertNull($query['values'] ?? null); $this->assertSame('orderRandom', $query['method']); } - public function testCursorBefore(): void { + public function testCursorBefore(): void + { $query = json_decode(Query::cursorBefore('attr'), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr'], $query['values']); $this->assertSame('cursorBefore', $query['method']); } - public function testCursorAfter(): void { + public function testCursorAfter(): void + { $query = json_decode(Query::cursorAfter('attr'), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr'], $query['values']); $this->assertSame('cursorAfter', $query['method']); } - public function testLimit(): void { + public function testLimit(): void + { $query = json_decode(Query::limit(1), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame([1], $query['values']); $this->assertSame('limit', $query['method']); } - public function testOffset(): void { + public function testOffset(): void + { $query = json_decode(Query::offset(1), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame([1], $query['values']); $this->assertSame('offset', $query['method']); } - public function testNotContains(): void { + public function testNotContains(): void + { $query = json_decode(Query::notContains('attr', 'value'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['value'], $query['values']); $this->assertSame('notContains', $query['method']); } - public function testNotSearch(): void { + public function testNotSearch(): void + { $query = json_decode(Query::notSearch('attr', 'keyword1 keyword2'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['keyword1 keyword2'], $query['values']); $this->assertSame('notSearch', $query['method']); } - public function testNotBetweenWithIntegers(): void { + public function testNotBetweenWithIntegers(): void + { $query = json_decode(Query::notBetween('attr', 1, 2), true); $this->assertSame('attr', $query['attribute']); $this->assertSame([1, 2], $query['values']); $this->assertSame('notBetween', $query['method']); } - public function testNotBetweenWithDoubles(): void { + public function testNotBetweenWithDoubles(): void + { $query = json_decode(Query::notBetween('attr', 1.0, 2.0), true); $this->assertSame('attr', $query['attribute']); $this->assertSame([1, 2], $query['values']); $this->assertSame('notBetween', $query['method']); } - public function testNotBetweenWithStrings(): void { + public function testNotBetweenWithStrings(): void + { $query = json_decode(Query::notBetween('attr', 'a', 'z'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['a', 'z'], $query['values']); $this->assertSame('notBetween', $query['method']); } - public function testNotStartsWith(): void { + public function testNotStartsWith(): void + { $query = json_decode(Query::notStartsWith('attr', 'prefix'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['prefix'], $query['values']); $this->assertSame('notStartsWith', $query['method']); } - public function testNotEndsWith(): void { + public function testNotEndsWith(): void + { $query = json_decode(Query::notEndsWith('attr', 'suffix'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['suffix'], $query['values']); $this->assertSame('notEndsWith', $query['method']); } - public function testRegex(): void { + public function testRegex(): void + { $query = json_decode(Query::regex('attr', 'pattern.*'), true); $this->assertSame('attr', $query['attribute']); $this->assertSame(['pattern.*'], $query['values']); $this->assertSame('regex', $query['method']); } - public function testExists(): void { + public function testExists(): void + { $query = json_decode(Query::exists(['attr1', 'attr2']), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr1', 'attr2'], $query['values']); $this->assertSame('exists', $query['method']); } - public function testNotExists(): void { + public function testNotExists(): void + { $query = json_decode(Query::notExists(['attr1', 'attr2']), true); $this->assertNull($query['attribute'] ?? null); $this->assertSame(['attr1', 'attr2'], $query['values']); $this->assertSame('notExists', $query['method']); } - public function testElemMatch(): void { + public function testElemMatch(): void + { $inner1 = Query::equal('name', 'Alice'); $inner2 = Query::greaterThan('age', 18); @@ -282,42 +314,48 @@ public function testElemMatch(): void { $this->assertSame([18], $query['values'][1]['values']); } - public function testCreatedBefore(): void { + public function testCreatedBefore(): void + { $query = json_decode(Query::createdBefore('2023-01-01'), true); $this->assertSame('$createdAt', $query['attribute']); $this->assertSame(['2023-01-01'], $query['values']); $this->assertSame('lessThan', $query['method']); } - public function testCreatedAfter(): void { + public function testCreatedAfter(): void + { $query = json_decode(Query::createdAfter('2023-01-01'), true); $this->assertSame('$createdAt', $query['attribute']); $this->assertSame(['2023-01-01'], $query['values']); $this->assertSame('greaterThan', $query['method']); } - public function testCreatedBetween(): void { + public function testCreatedBetween(): void + { $query = json_decode(Query::createdBetween('2023-01-01', '2023-12-31'), true); $this->assertSame('$createdAt', $query['attribute']); $this->assertSame(['2023-01-01', '2023-12-31'], $query['values']); $this->assertSame('between', $query['method']); } - public function testUpdatedBefore(): void { + public function testUpdatedBefore(): void + { $query = json_decode(Query::updatedBefore('2023-01-01'), true); $this->assertSame('$updatedAt', $query['attribute']); $this->assertSame(['2023-01-01'], $query['values']); $this->assertSame('lessThan', $query['method']); } - public function testUpdatedAfter(): void { + public function testUpdatedAfter(): void + { $query = json_decode(Query::updatedAfter('2023-01-01'), true); $this->assertSame('$updatedAt', $query['attribute']); $this->assertSame(['2023-01-01'], $query['values']); $this->assertSame('greaterThan', $query['method']); } - public function testUpdatedBetween(): void { + public function testUpdatedBetween(): void + { $query = json_decode(Query::updatedBetween('2023-01-01', '2023-12-31'), true); $this->assertSame('$updatedAt', $query['attribute']); $this->assertSame(['2023-01-01', '2023-12-31'], $query['values']); diff --git a/tests/Appwrite/RoleTest.php b/tests/Appwrite/RoleTest.php index f6e0be1c..3fb95048 100644 --- a/tests/Appwrite/RoleTest.php +++ b/tests/Appwrite/RoleTest.php @@ -1,47 +1,60 @@ assertSame('any', Role::any()); } - public function testUserWithoutStatus(): void { + public function testUserWithoutStatus(): void + { $this->assertSame('user:custom', Role::user('custom')); } - public function testUserWithStatus(): void { + public function testUserWithStatus(): void + { $this->assertSame('user:custom/verified', Role::user('custom', 'verified')); } - public function testUsersWithoutStatus(): void { + public function testUsersWithoutStatus(): void + { $this->assertSame('users', Role::users()); } - public function testUsersWithStatus(): void { + public function testUsersWithStatus(): void + { $this->assertSame('users/verified', Role::users('verified')); } - public function testGuests(): void { + public function testGuests(): void + { $this->assertSame('guests', Role::guests()); } - public function testTeamWithoutRole(): void { + public function testTeamWithoutRole(): void + { $this->assertSame('team:custom', Role::team('custom')); } - public function testTeamWithRole(): void { + public function testTeamWithRole(): void + { $this->assertSame('team:custom/owner', Role::team('custom', 'owner')); } - public function testMember(): void { + public function testMember(): void + { $this->assertSame('member:custom', Role::member('custom')); } - public function testLabel(): void { + public function testLabel(): void + { $this->assertSame('label:admin', Role::label('admin')); } } diff --git a/tests/Appwrite/Services/AccountTest.php b/tests/Appwrite/Services/AccountTest.php index 28c9db86..1e4565d9 100644 --- a/tests/Appwrite/Services/AccountTest.php +++ b/tests/Appwrite/Services/AccountTest.php @@ -1,10 +1,12 @@ "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -48,10 +50,10 @@ public function testMethodGet(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -64,26 +66,25 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -92,10 +93,10 @@ public function testMethodCreate(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -112,26 +113,25 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListConsents(): void { - $data = array( + $data = [ "total" => 5, - "consents" => array( - array( + "consents" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", "cimdUrl" => "https://example.com/.well-known/client-metadata.json", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "expire" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -144,21 +144,20 @@ public function testMethodListConsents(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentList::class, $response); } - public function testMethodGetConsent(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", "cimdUrl" => "https://example.com/.well-known/client-metadata.json", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -173,7 +172,6 @@ public function testMethodGetConsent(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Consent::class, $response); } - public function testMethodDeleteConsent(): void { $data = ''; @@ -191,13 +189,12 @@ public function testMethodDeleteConsent(): void $this->assertSame($data, $response); } - public function testMethodListConsentTokens(): void { - $data = array( + $data = [ "total" => 5, - "tokens" => array( - array( + "tokens" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -205,13 +202,13 @@ public function testMethodListConsentTokens(): void "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", "cimdUrl" => "https://example.com/.well-known/client-metadata.json", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "expire" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -226,10 +223,9 @@ public function testMethodListConsentTokens(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentTokenList::class, $response); } - public function testMethodGetConsentToken(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -237,11 +233,11 @@ public function testMethodGetConsentToken(): void "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", "cimdUrl" => "https://example.com/.well-known/client-metadata.json", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -257,7 +253,6 @@ public function testMethodGetConsentToken(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2ConsentToken::class, $response); } - public function testMethodDeleteConsentToken(): void { $data = ''; @@ -276,26 +271,25 @@ public function testMethodDeleteConsentToken(): void $this->assertSame($data, $response); } - public function testMethodUpdateEmail(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -304,10 +298,10 @@ public function testMethodUpdateEmail(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -323,13 +317,12 @@ public function testMethodUpdateEmail(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListIdentities(): void { - $data = array( + $data = [ "total" => 5, - "identities" => array( - array( + "identities" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -340,9 +333,9 @@ public function testMethodListIdentities(): void "providerAccessToken" => "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", "providerAccessTokenExpiry" => "2020-10-15T06:38:00.000+00:00", "providerRefreshToken" => "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -355,7 +348,6 @@ public function testMethodListIdentities(): void $this->assertInstanceOf(\Appwrite\Models\IdentityList::class, $response); } - public function testMethodDeleteIdentity(): void { $data = ''; @@ -373,13 +365,12 @@ public function testMethodDeleteIdentity(): void $this->assertSame($data, $response); } - public function testMethodListLogs(): void { - $data = array( + $data = [ "total" => 5, - "logs" => array( - array( + "logs" => [ + [ "event" => "account.sessions.create", "userId" => "610fc2f985ee0", "userEmail" => "john@appwrite.io", @@ -402,9 +393,9 @@ public function testMethodListLogs(): void "deviceModel" => "Nexus 5", "countryCode" => "US", "countryName" => "United States" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -417,26 +408,25 @@ public function testMethodListLogs(): void $this->assertInstanceOf(\Appwrite\Models\LogList::class, $response); } - public function testMethodUpdateMFA(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -445,10 +435,10 @@ public function testMethodUpdateMFA(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -463,13 +453,12 @@ public function testMethodUpdateMFA(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateMFAAuthenticator(): void { - $data = array( + $data = [ "secret" => "[SHARED_SECRET]", "uri" => "otpauth://totp/appwrite:user@example.com?secret=[SHARED_SECRET]&issuer=appwrite" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -484,26 +473,25 @@ public function testMethodCreateMFAAuthenticator(): void $this->assertInstanceOf(\Appwrite\Models\MfaType::class, $response); } - public function testMethodUpdateMFAAuthenticator(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -512,10 +500,10 @@ public function testMethodUpdateMFAAuthenticator(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -531,7 +519,6 @@ public function testMethodUpdateMFAAuthenticator(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodDeleteMFAAuthenticator(): void { $data = ''; @@ -549,15 +536,14 @@ public function testMethodDeleteMFAAuthenticator(): void $this->assertSame($data, $response); } - public function testMethodCreateMFAChallenge(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -572,10 +558,9 @@ public function testMethodCreateMFAChallenge(): void $this->assertInstanceOf(\Appwrite\Models\MfaChallenge::class, $response); } - public function testMethodUpdateMFAChallenge(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -602,10 +587,10 @@ public function testMethodUpdateMFAChallenge(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -621,16 +606,15 @@ public function testMethodUpdateMFAChallenge(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodListMFAFactors(): void { - $data = array( + $data = [ "totp" => true, "phone" => true, "email" => true, "recoveryCode" => true, "custom" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -643,12 +627,11 @@ public function testMethodListMFAFactors(): void $this->assertInstanceOf(\Appwrite\Models\MfaFactors::class, $response); } - public function testMethodGetMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -661,12 +644,11 @@ public function testMethodGetMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodCreateMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -679,12 +661,11 @@ public function testMethodCreateMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodUpdateMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -697,26 +678,25 @@ public function testMethodUpdateMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodUpdateName(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -725,10 +705,10 @@ public function testMethodUpdateName(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -743,26 +723,25 @@ public function testMethodUpdateName(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePassword(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -771,10 +750,10 @@ public function testMethodUpdatePassword(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -789,26 +768,25 @@ public function testMethodUpdatePassword(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePhone(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -817,10 +795,10 @@ public function testMethodUpdatePhone(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -836,10 +814,9 @@ public function testMethodUpdatePhone(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodGetPrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -852,26 +829,25 @@ public function testMethodGetPrefs(): void $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - public function testMethodUpdatePrefs(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -880,10 +856,10 @@ public function testMethodUpdatePrefs(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -893,22 +869,21 @@ public function testMethodUpdatePrefs(): void ->andReturn(''); $response = $this->account->updatePrefs( - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateRecovery(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -924,17 +899,16 @@ public function testMethodCreateRecovery(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdateRecovery(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -951,13 +925,12 @@ public function testMethodUpdateRecovery(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodListSessions(): void { - $data = array( + $data = [ "total" => 5, - "sessions" => array( - array( + "sessions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -984,12 +957,12 @@ public function testMethodListSessions(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1002,7 +975,6 @@ public function testMethodListSessions(): void $this->assertInstanceOf(\Appwrite\Models\SessionList::class, $response); } - public function testMethodDeleteSessions(): void { $data = ''; @@ -1018,10 +990,9 @@ public function testMethodDeleteSessions(): void $this->assertSame($data, $response); } - public function testMethodCreateAnonymousSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1048,10 +1019,10 @@ public function testMethodCreateAnonymousSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1064,10 +1035,9 @@ public function testMethodCreateAnonymousSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodCreateEmailPasswordSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1094,10 +1064,10 @@ public function testMethodCreateEmailPasswordSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1113,10 +1083,9 @@ public function testMethodCreateEmailPasswordSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodUpdateMagicURLSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1143,10 +1112,10 @@ public function testMethodUpdateMagicURLSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1162,10 +1131,9 @@ public function testMethodUpdateMagicURLSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodUpdatePhoneSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1192,10 +1160,10 @@ public function testMethodUpdatePhoneSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1211,10 +1179,9 @@ public function testMethodUpdatePhoneSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodCreateSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1241,10 +1208,10 @@ public function testMethodCreateSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1260,10 +1227,9 @@ public function testMethodCreateSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodGetSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1290,10 +1256,10 @@ public function testMethodGetSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1308,10 +1274,9 @@ public function testMethodGetSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodUpdateSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1338,10 +1303,10 @@ public function testMethodUpdateSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1356,7 +1321,6 @@ public function testMethodUpdateSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodDeleteSession(): void { $data = ''; @@ -1374,26 +1338,25 @@ public function testMethodDeleteSession(): void $this->assertSame($data, $response); } - public function testMethodUpdateStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1402,10 +1365,10 @@ public function testMethodUpdateStatus(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1418,17 +1381,16 @@ public function testMethodUpdateStatus(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateEmailToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1444,17 +1406,16 @@ public function testMethodCreateEmailToken(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreateMagicURLToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1470,7 +1431,6 @@ public function testMethodCreateMagicURLToken(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreateOAuth2Token(): void { $data = ''; @@ -1488,17 +1448,16 @@ public function testMethodCreateOAuth2Token(): void $this->assertSame($data, $response); } - public function testMethodCreatePhoneToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1514,17 +1473,16 @@ public function testMethodCreatePhoneToken(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreateEmailVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1539,17 +1497,16 @@ public function testMethodCreateEmailVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreateVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1564,17 +1521,16 @@ public function testMethodCreateVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdateEmailVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1590,17 +1546,16 @@ public function testMethodUpdateEmailVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdateVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1616,17 +1571,16 @@ public function testMethodUpdateVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodCreatePhoneVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1639,17 +1593,16 @@ public function testMethodCreatePhoneVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdatePhoneVerification(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1665,5 +1618,4 @@ public function testMethodUpdatePhoneVerification(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - } diff --git a/tests/Appwrite/Services/ActivitiesTest.php b/tests/Appwrite/Services/ActivitiesTest.php index b1d16072..9c7a7045 100644 --- a/tests/Appwrite/Services/ActivitiesTest.php +++ b/tests/Appwrite/Services/ActivitiesTest.php @@ -1,16 +1,18 @@ 5, - "events" => array( - array( + "events" => [ + [ "\$id" => "5e5ea5c16897e", "actorType" => "user", "actorId" => "610fc2f985ee0", @@ -53,9 +55,9 @@ public function testMethodListEvents(): void "hostname" => "appwrite.io", "sdk" => "web", "sdkVersion" => "14.0.0" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -68,10 +70,9 @@ public function testMethodListEvents(): void $this->assertInstanceOf(\Appwrite\Models\ActivityEventList::class, $response); } - public function testMethodGetEvent(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "actorType" => "user", "actorId" => "610fc2f985ee0", @@ -101,7 +102,7 @@ public function testMethodGetEvent(): void "hostname" => "appwrite.io", "sdk" => "web", "sdkVersion" => "14.0.0" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -116,5 +117,4 @@ public function testMethodGetEvent(): void $this->assertInstanceOf(\Appwrite\Models\ActivityEvent::class, $response); } - } diff --git a/tests/Appwrite/Services/AdvisorTest.php b/tests/Appwrite/Services/AdvisorTest.php index 1c4f54f9..7d3b5857 100644 --- a/tests/Appwrite/Services/AdvisorTest.php +++ b/tests/Appwrite/Services/AdvisorTest.php @@ -1,16 +1,18 @@ 5, - "reports" => array( - array( + "reports" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -33,9 +35,9 @@ public function testMethodListReports(): void "summary" => "Performance score 78. 4 opportunities found.", "targetType" => "urls", "target" => "https://appwrite.io/", - "categories" => array(), - "insights" => array( - array( + "categories" => [], + "insights" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -49,19 +51,19 @@ public function testMethodListReports(): void "parentResourceId" => "orders", "title" => "Missing index on collection orders", "summary" => "Queries against `orders.status` are scanning the full collection.", - "ctas" => array( - array( + "ctas" => [ + [ "label" => "Create missing index", "service" => "tablesDB", "method" => "createIndex", - "params" => array() - ) - ) - ) - ) - ) - ) - ); + "params" => [] + ] + ] + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -74,10 +76,9 @@ public function testMethodListReports(): void $this->assertInstanceOf(\Appwrite\Models\ReportList::class, $response); } - public function testMethodGetReport(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -87,9 +88,9 @@ public function testMethodGetReport(): void "summary" => "Performance score 78. 4 opportunities found.", "targetType" => "urls", "target" => "https://appwrite.io/", - "categories" => array(), - "insights" => array( - array( + "categories" => [], + "insights" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -103,17 +104,17 @@ public function testMethodGetReport(): void "parentResourceId" => "orders", "title" => "Missing index on collection orders", "summary" => "Queries against `orders.status` are scanning the full collection.", - "ctas" => array( - array( + "ctas" => [ + [ "label" => "Create missing index", "service" => "tablesDB", "method" => "createIndex", - "params" => array() - ) - ) - ) - ) - ); + "params" => [] + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -128,7 +129,6 @@ public function testMethodGetReport(): void $this->assertInstanceOf(\Appwrite\Models\Report::class, $response); } - public function testMethodDeleteReport(): void { $data = ''; @@ -146,13 +146,12 @@ public function testMethodDeleteReport(): void $this->assertSame($data, $response); } - public function testMethodListInsights(): void { - $data = array( + $data = [ "total" => 5, - "insights" => array( - array( + "insights" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -166,17 +165,17 @@ public function testMethodListInsights(): void "parentResourceId" => "orders", "title" => "Missing index on collection orders", "summary" => "Queries against `orders.status` are scanning the full collection.", - "ctas" => array( - array( + "ctas" => [ + [ "label" => "Create missing index", "service" => "tablesDB", "method" => "createIndex", - "params" => array() - ) - ) - ) - ) - ); + "params" => [] + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -191,10 +190,9 @@ public function testMethodListInsights(): void $this->assertInstanceOf(\Appwrite\Models\InsightList::class, $response); } - public function testMethodGetInsight(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -208,15 +206,15 @@ public function testMethodGetInsight(): void "parentResourceId" => "orders", "title" => "Missing index on collection orders", "summary" => "Queries against `orders.status` are scanning the full collection.", - "ctas" => array( - array( + "ctas" => [ + [ "label" => "Create missing index", "service" => "tablesDB", "method" => "createIndex", - "params" => array() - ) - ) - ); + "params" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -232,5 +230,4 @@ public function testMethodGetInsight(): void $this->assertInstanceOf(\Appwrite\Models\Insight::class, $response); } - } diff --git a/tests/Appwrite/Services/AppsTest.php b/tests/Appwrite/Services/AppsTest.php index 2e29a9d9..76da1cb0 100644 --- a/tests/Appwrite/Services/AppsTest.php +++ b/tests/Appwrite/Services/AppsTest.php @@ -1,16 +1,18 @@ 5, - "apps" => array( - array( + "apps" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -33,24 +35,24 @@ public function testMethodList(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -59,11 +61,11 @@ public function testMethodList(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ) - ) - ); + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -76,10 +78,9 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\AppsList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -89,24 +90,24 @@ public function testMethodCreate(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -115,9 +116,9 @@ public function testMethodCreate(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -129,26 +130,25 @@ public function testMethodCreate(): void $response = $this->apps->create( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodListInstallationScopes(): void { - $data = array( + $data = [ "total" => 5, - "scopes" => array( - array( + "scopes" => [ + [ "value" => "organization:organization.read", "description" => "Access to read the organization", "type" => "organization", "category" => "Organization", "deprecated" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -161,21 +161,20 @@ public function testMethodListInstallationScopes(): void $this->assertInstanceOf(\Appwrite\Models\AppScopeList::class, $response); } - public function testMethodListOAuth2Scopes(): void { - $data = array( + $data = [ "total" => 5, - "scopes" => array( - array( + "scopes" => [ + [ "value" => "organization:organization.read", "description" => "Access to read the organization", "type" => "organization", "category" => "Organization", "deprecated" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -188,10 +187,9 @@ public function testMethodListOAuth2Scopes(): void $this->assertInstanceOf(\Appwrite\Models\AppScopeList::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -201,24 +199,24 @@ public function testMethodGet(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -227,9 +225,9 @@ public function testMethodGet(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -244,10 +242,9 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -257,24 +254,24 @@ public function testMethodUpdate(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -283,9 +280,9 @@ public function testMethodUpdate(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -301,7 +298,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -319,25 +315,24 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListInstallations(): void { - $data = array( + $data = [ "total" => 5, - "installations" => array( - array( + "installations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -352,20 +347,19 @@ public function testMethodListInstallations(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); } - public function testMethodGetInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -381,7 +375,6 @@ public function testMethodGetInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodDeleteInstallation(): void { $data = ''; @@ -400,16 +393,15 @@ public function testMethodDeleteInstallation(): void $this->assertSame($data, $response); } - public function testMethodCreateInstallationToken(): void { - $data = array( + $data = [ "access_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...", "token_type" => "Bearer", "expires_in" => 3600, "refresh_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "scope" => "openid email profile" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -425,13 +417,12 @@ public function testMethodCreateInstallationToken(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Token::class, $response); } - public function testMethodListKeys(): void { - $data = array( + $data = [ "total" => 5, - "keys" => array( - array( + "keys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -440,9 +431,9 @@ public function testMethodListKeys(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -457,10 +448,9 @@ public function testMethodListKeys(): void $this->assertInstanceOf(\Appwrite\Models\AppKeyList::class, $response); } - public function testMethodCreateKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -469,7 +459,7 @@ public function testMethodCreateKey(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -484,10 +474,9 @@ public function testMethodCreateKey(): void $this->assertInstanceOf(\Appwrite\Models\AppKey::class, $response); } - public function testMethodGetKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -496,7 +485,7 @@ public function testMethodGetKey(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -512,7 +501,6 @@ public function testMethodGetKey(): void $this->assertInstanceOf(\Appwrite\Models\AppKey::class, $response); } - public function testMethodDeleteKey(): void { $data = ''; @@ -531,10 +519,9 @@ public function testMethodDeleteKey(): void $this->assertSame($data, $response); } - public function testMethodUpdateLabels(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -544,24 +531,24 @@ public function testMethodUpdateLabels(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -570,9 +557,9 @@ public function testMethodUpdateLabels(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -583,18 +570,17 @@ public function testMethodUpdateLabels(): void $response = $this->apps->updateLabels( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodListSecrets(): void { - $data = array( + $data = [ "total" => 5, - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -603,9 +589,9 @@ public function testMethodListSecrets(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -620,10 +606,9 @@ public function testMethodListSecrets(): void $this->assertInstanceOf(\Appwrite\Models\AppSecretList::class, $response); } - public function testMethodCreateSecret(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -632,7 +617,7 @@ public function testMethodCreateSecret(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -647,10 +632,9 @@ public function testMethodCreateSecret(): void $this->assertInstanceOf(\Appwrite\Models\AppSecretPlaintext::class, $response); } - public function testMethodGetSecret(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -659,7 +643,7 @@ public function testMethodGetSecret(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -675,7 +659,6 @@ public function testMethodGetSecret(): void $this->assertInstanceOf(\Appwrite\Models\AppSecret::class, $response); } - public function testMethodDeleteSecret(): void { $data = ''; @@ -694,10 +677,9 @@ public function testMethodDeleteSecret(): void $this->assertSame($data, $response); } - public function testMethodUpdateTeam(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -707,24 +689,24 @@ public function testMethodUpdateTeam(): void "logoUri" => "https://example.com/logo.png", "privacyPolicyUrl" => "https://example.com/privacy", "termsUrl" => "https://example.com/terms", - "contacts" => array(), + "contacts" => [], "tagline" => "Automate your workspace.", - "tags" => array(), - "labels" => array(), - "images" => array(), + "tags" => [], + "labels" => [], + "images" => [], "supportUrl" => "https://example.com/support", "dataDeletionUrl" => "https://example.com/data-deletion", - "redirectUris" => array(), - "postLogoutRedirectUris" => array(), + "redirectUris" => [], + "postLogoutRedirectUris" => [], "enabled" => true, "type" => "confidential", "deviceFlow" => true, "teamId" => "5e5ea5c16897e", "userId" => "5e5ea5c16897e", - "installationScopes" => array(), + "installationScopes" => [], "installationRedirectUrl" => "https://example.com/setup", - "secrets" => array( - array( + "secrets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -733,9 +715,9 @@ public function testMethodUpdateTeam(): void "hint" => "f5c6c7", "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -751,7 +733,6 @@ public function testMethodUpdateTeam(): void $this->assertInstanceOf(\Appwrite\Models\App::class, $response); } - public function testMethodDeleteTokens(): void { $data = ''; @@ -769,5 +750,4 @@ public function testMethodDeleteTokens(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/AvatarsTest.php b/tests/Appwrite/Services/AvatarsTest.php index e299e3c6..cfa7469f 100644 --- a/tests/Appwrite/Services/AvatarsTest.php +++ b/tests/Appwrite/Services/AvatarsTest.php @@ -1,23 +1,21 @@ assertSame($data, $response); } - public function testMethodGetCreditCard(): void { $data = ''; @@ -60,7 +57,6 @@ public function testMethodGetCreditCard(): void $this->assertSame($data, $response); } - public function testMethodGetFavicon(): void { $data = ''; @@ -78,7 +74,6 @@ public function testMethodGetFavicon(): void $this->assertSame($data, $response); } - public function testMethodGetFlag(): void { $data = ''; @@ -96,7 +91,6 @@ public function testMethodGetFlag(): void $this->assertSame($data, $response); } - public function testMethodGetImage(): void { $data = ''; @@ -114,7 +108,6 @@ public function testMethodGetImage(): void $this->assertSame($data, $response); } - public function testMethodGetInitials(): void { $data = ''; @@ -130,7 +123,21 @@ public function testMethodGetInitials(): void $this->assertSame($data, $response); } + public function testMethodGetPhoto(): void + { + $data = ''; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + $response = $this->avatars->getPhoto(); + + $this->assertSame($data, $response); + } public function testMethodGetQR(): void { $data = ''; @@ -148,7 +155,6 @@ public function testMethodGetQR(): void $this->assertSame($data, $response); } - public function testMethodGetScreenshot(): void { $data = ''; @@ -166,5 +172,4 @@ public function testMethodGetScreenshot(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/BackupsTest.php b/tests/Appwrite/Services/BackupsTest.php index ee9d09d4..353bd0d7 100644 --- a/tests/Appwrite/Services/BackupsTest.php +++ b/tests/Appwrite/Services/BackupsTest.php @@ -1,17 +1,19 @@ 5, - "archives" => array( - array( + "archives" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -33,11 +35,11 @@ public function testMethodListArchives(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ) - ) - ); + "services" => [], + "resources" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -50,10 +52,9 @@ public function testMethodListArchives(): void $this->assertInstanceOf(\Appwrite\Models\BackupArchiveList::class, $response); } - public function testMethodCreateArchive(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -62,9 +63,9 @@ public function testMethodCreateArchive(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ); + "services" => [], + "resources" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -74,15 +75,14 @@ public function testMethodCreateArchive(): void ->andReturn(''); $response = $this->backups->createArchive( - array(BackupServices::DATABASES()) + [BackupServices::DATABASES()] ); $this->assertInstanceOf(\Appwrite\Models\BackupArchive::class, $response); } - public function testMethodGetArchive(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -91,9 +91,9 @@ public function testMethodGetArchive(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array() - ); + "services" => [], + "resources" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -108,7 +108,6 @@ public function testMethodGetArchive(): void $this->assertInstanceOf(\Appwrite\Models\BackupArchive::class, $response); } - public function testMethodDeleteArchive(): void { $data = ''; @@ -126,26 +125,25 @@ public function testMethodDeleteArchive(): void $this->assertSame($data, $response); } - public function testMethodListPolicies(): void { - $data = array( + $data = [ "total" => 5, - "policies" => array( - array( + "policies" => [ + [ "\$id" => "5e5ea5c16897e", "name" => "Hourly backups", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "retention" => 7, "schedule" => "0 * * * *", "type" => "full", "enabled" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -158,21 +156,20 @@ public function testMethodListPolicies(): void $this->assertInstanceOf(\Appwrite\Models\BackupPolicyList::class, $response); } - public function testMethodCreatePolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "Hourly backups", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "retention" => 7, "schedule" => "0 * * * *", "type" => "full", "enabled" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -183,28 +180,27 @@ public function testMethodCreatePolicy(): void $response = $this->backups->createPolicy( "", - array(BackupServices::DATABASES()), + [BackupServices::DATABASES()], 1, "" ); $this->assertInstanceOf(\Appwrite\Models\BackupPolicy::class, $response); } - public function testMethodGetPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "Hourly backups", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "retention" => 7, "schedule" => "0 * * * *", "type" => "full", "enabled" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -219,21 +215,20 @@ public function testMethodGetPolicy(): void $this->assertInstanceOf(\Appwrite\Models\BackupPolicy::class, $response); } - public function testMethodUpdatePolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "Hourly backups", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "retention" => 7, "schedule" => "0 * * * *", "type" => "full", "enabled" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -248,7 +243,6 @@ public function testMethodUpdatePolicy(): void $this->assertInstanceOf(\Appwrite\Models\BackupPolicy::class, $response); } - public function testMethodDeletePolicy(): void { $data = ''; @@ -266,10 +260,9 @@ public function testMethodDeletePolicy(): void $this->assertSame($data, $response); } - public function testMethodCreateRestoration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -278,10 +271,10 @@ public function testMethodCreateRestoration(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "options" => "{databases.database[{oldId, newId, newName}]}" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -292,18 +285,17 @@ public function testMethodCreateRestoration(): void $response = $this->backups->createRestoration( "", - array(BackupServices::DATABASES()) + [BackupServices::DATABASES()] ); $this->assertInstanceOf(\Appwrite\Models\BackupRestoration::class, $response); } - public function testMethodListRestorations(): void { - $data = array( + $data = [ "total" => 5, - "restorations" => array( - array( + "restorations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -312,12 +304,12 @@ public function testMethodListRestorations(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "options" => "{databases.database[{oldId, newId, newName}]}" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -330,10 +322,9 @@ public function testMethodListRestorations(): void $this->assertInstanceOf(\Appwrite\Models\BackupRestorationList::class, $response); } - public function testMethodGetRestoration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -342,10 +333,10 @@ public function testMethodGetRestoration(): void "status" => "completed", "startedAt" => "2020-10-15T06:38:00.000+00:00", "migrationId" => "did8jx6ws45jana098ab7", - "services" => array(), - "resources" => array(), + "services" => [], + "resources" => [], "options" => "{databases.database[{oldId, newId, newName}]}" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -360,5 +351,4 @@ public function testMethodGetRestoration(): void $this->assertInstanceOf(\Appwrite\Models\BackupRestoration::class, $response); } - } diff --git a/tests/Appwrite/Services/DatabasesTest.php b/tests/Appwrite/Services/DatabasesTest.php index cacd8583..4c61a66a 100644 --- a/tests/Appwrite/Services/DatabasesTest.php +++ b/tests/Appwrite/Services/DatabasesTest.php @@ -1,20 +1,20 @@ 5, - "databases" => array( - array( + "databases" => [ + [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -49,17 +49,16 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -75,22 +74,21 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodListTransactions(): void { - $data = array( + $data = [ "total" => 5, - "transactions" => array( - array( + "transactions" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -103,17 +101,16 @@ public function testMethodListTransactions(): void $this->assertInstanceOf(\Appwrite\Models\TransactionList::class, $response); } - public function testMethodCreateTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -126,17 +123,16 @@ public function testMethodCreateTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodGetTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -151,17 +147,16 @@ public function testMethodGetTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodUpdateTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -176,7 +171,6 @@ public function testMethodUpdateTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodDeleteTransaction(): void { $data = ''; @@ -194,17 +188,16 @@ public function testMethodDeleteTransaction(): void $this->assertSame($data, $response); } - public function testMethodCreateOperations(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -219,17 +212,16 @@ public function testMethodCreateOperations(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -244,17 +236,16 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -269,7 +260,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -287,24 +277,23 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListCollections(): void { - $data = array( + $data = [ "total" => 5, - "collections" => array( - array( + "collections" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Collection", "enabled" => true, "documentSecurity" => true, - "attributes" => array(), - "indexes" => array( - array( + "attributes" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -312,15 +301,15 @@ public function testMethodListCollections(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ), + "attributes" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -335,21 +324,20 @@ public function testMethodListCollections(): void $this->assertInstanceOf(\Appwrite\Models\CollectionList::class, $response); } - public function testMethodCreateCollection(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Collection", "enabled" => true, "documentSecurity" => true, - "attributes" => array(), - "indexes" => array( - array( + "attributes" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -357,13 +345,13 @@ public function testMethodCreateCollection(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ), + "attributes" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -380,21 +368,20 @@ public function testMethodCreateCollection(): void $this->assertInstanceOf(\Appwrite\Models\Collection::class, $response); } - public function testMethodGetCollection(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Collection", "enabled" => true, "documentSecurity" => true, - "attributes" => array(), - "indexes" => array( - array( + "attributes" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -402,13 +389,13 @@ public function testMethodGetCollection(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ), + "attributes" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -424,21 +411,20 @@ public function testMethodGetCollection(): void $this->assertInstanceOf(\Appwrite\Models\Collection::class, $response); } - public function testMethodUpdateCollection(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Collection", "enabled" => true, "documentSecurity" => true, - "attributes" => array(), - "indexes" => array( - array( + "attributes" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -446,13 +432,13 @@ public function testMethodUpdateCollection(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ), + "attributes" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -468,7 +454,6 @@ public function testMethodUpdateCollection(): void $this->assertInstanceOf(\Appwrite\Models\Collection::class, $response); } - public function testMethodDeleteCollection(): void { $data = ''; @@ -487,13 +472,12 @@ public function testMethodDeleteCollection(): void $this->assertSame($data, $response); } - public function testMethodListAttributes(): void { - $data = array( + $data = [ "total" => 5, - "attributes" => array() - ); + "attributes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -509,10 +493,9 @@ public function testMethodListAttributes(): void $this->assertInstanceOf(\Appwrite\Models\AttributeList::class, $response); } - public function testMethodCreateBigIntAttribute(): void { - $data = array( + $data = [ "key" => "count", "type" => "bigint", "status" => "available", @@ -520,7 +503,7 @@ public function testMethodCreateBigIntAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -538,10 +521,9 @@ public function testMethodCreateBigIntAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeBigint::class, $response); } - public function testMethodUpdateBigIntAttribute(): void { - $data = array( + $data = [ "key" => "count", "type" => "bigint", "status" => "available", @@ -549,7 +531,7 @@ public function testMethodUpdateBigIntAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -568,10 +550,9 @@ public function testMethodUpdateBigIntAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeBigint::class, $response); } - public function testMethodCreateBooleanAttribute(): void { - $data = array( + $data = [ "key" => "isEnabled", "type" => "boolean", "status" => "available", @@ -579,7 +560,7 @@ public function testMethodCreateBooleanAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -597,10 +578,9 @@ public function testMethodCreateBooleanAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeBoolean::class, $response); } - public function testMethodUpdateBooleanAttribute(): void { - $data = array( + $data = [ "key" => "isEnabled", "type" => "boolean", "status" => "available", @@ -608,7 +588,7 @@ public function testMethodUpdateBooleanAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -627,10 +607,9 @@ public function testMethodUpdateBooleanAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeBoolean::class, $response); } - public function testMethodCreateDatetimeAttribute(): void { - $data = array( + $data = [ "key" => "birthDay", "type" => "datetime", "status" => "available", @@ -639,7 +618,7 @@ public function testMethodCreateDatetimeAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -657,10 +636,9 @@ public function testMethodCreateDatetimeAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeDatetime::class, $response); } - public function testMethodUpdateDatetimeAttribute(): void { - $data = array( + $data = [ "key" => "birthDay", "type" => "datetime", "status" => "available", @@ -669,7 +647,7 @@ public function testMethodUpdateDatetimeAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -688,10 +666,9 @@ public function testMethodUpdateDatetimeAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeDatetime::class, $response); } - public function testMethodCreateEmailAttribute(): void { - $data = array( + $data = [ "key" => "userEmail", "type" => "string", "status" => "available", @@ -700,7 +677,7 @@ public function testMethodCreateEmailAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -718,10 +695,9 @@ public function testMethodCreateEmailAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeEmail::class, $response); } - public function testMethodUpdateEmailAttribute(): void { - $data = array( + $data = [ "key" => "userEmail", "type" => "string", "status" => "available", @@ -730,7 +706,7 @@ public function testMethodUpdateEmailAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -749,10 +725,9 @@ public function testMethodUpdateEmailAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeEmail::class, $response); } - public function testMethodCreateEnumAttribute(): void { - $data = array( + $data = [ "key" => "status", "type" => "string", "status" => "available", @@ -760,9 +735,9 @@ public function testMethodCreateEnumAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "elements" => array(), + "elements" => [], "format" => "enum" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -775,16 +750,15 @@ public function testMethodCreateEnumAttribute(): void "", "", "", - array(), + [], true ); $this->assertInstanceOf(\Appwrite\Models\AttributeEnum::class, $response); } - public function testMethodUpdateEnumAttribute(): void { - $data = array( + $data = [ "key" => "status", "type" => "string", "status" => "available", @@ -792,9 +766,9 @@ public function testMethodUpdateEnumAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "elements" => array(), + "elements" => [], "format" => "enum" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -807,17 +781,16 @@ public function testMethodUpdateEnumAttribute(): void "", "", "", - array(), + [], true, "" ); $this->assertInstanceOf(\Appwrite\Models\AttributeEnum::class, $response); } - public function testMethodCreateFloatAttribute(): void { - $data = array( + $data = [ "key" => "percentageCompleted", "type" => "double", "status" => "available", @@ -825,7 +798,7 @@ public function testMethodCreateFloatAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -843,10 +816,9 @@ public function testMethodCreateFloatAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeFloat::class, $response); } - public function testMethodUpdateFloatAttribute(): void { - $data = array( + $data = [ "key" => "percentageCompleted", "type" => "double", "status" => "available", @@ -854,7 +826,7 @@ public function testMethodUpdateFloatAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -873,10 +845,9 @@ public function testMethodUpdateFloatAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeFloat::class, $response); } - public function testMethodCreateIntegerAttribute(): void { - $data = array( + $data = [ "key" => "count", "type" => "integer", "status" => "available", @@ -884,7 +855,7 @@ public function testMethodCreateIntegerAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -902,10 +873,9 @@ public function testMethodCreateIntegerAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeInteger::class, $response); } - public function testMethodUpdateIntegerAttribute(): void { - $data = array( + $data = [ "key" => "count", "type" => "integer", "status" => "available", @@ -913,7 +883,7 @@ public function testMethodUpdateIntegerAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -932,10 +902,9 @@ public function testMethodUpdateIntegerAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeInteger::class, $response); } - public function testMethodCreateIpAttribute(): void { - $data = array( + $data = [ "key" => "ipAddress", "type" => "string", "status" => "available", @@ -944,7 +913,7 @@ public function testMethodCreateIpAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -962,10 +931,9 @@ public function testMethodCreateIpAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeIp::class, $response); } - public function testMethodUpdateIpAttribute(): void { - $data = array( + $data = [ "key" => "ipAddress", "type" => "string", "status" => "available", @@ -974,7 +942,7 @@ public function testMethodUpdateIpAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -993,10 +961,9 @@ public function testMethodUpdateIpAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeIp::class, $response); } - public function testMethodCreateLineAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1004,7 +971,7 @@ public function testMethodCreateLineAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1022,10 +989,9 @@ public function testMethodCreateLineAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeLine::class, $response); } - public function testMethodUpdateLineAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1033,7 +999,7 @@ public function testMethodUpdateLineAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1051,10 +1017,9 @@ public function testMethodUpdateLineAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeLine::class, $response); } - public function testMethodCreateLongtextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1062,7 +1027,7 @@ public function testMethodCreateLongtextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1080,10 +1045,9 @@ public function testMethodCreateLongtextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeLongtext::class, $response); } - public function testMethodUpdateLongtextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1091,7 +1055,7 @@ public function testMethodUpdateLongtextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1110,10 +1074,9 @@ public function testMethodUpdateLongtextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeLongtext::class, $response); } - public function testMethodCreateMediumtextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1121,7 +1084,7 @@ public function testMethodCreateMediumtextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1139,10 +1102,9 @@ public function testMethodCreateMediumtextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeMediumtext::class, $response); } - public function testMethodUpdateMediumtextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1150,7 +1112,7 @@ public function testMethodUpdateMediumtextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1169,10 +1131,9 @@ public function testMethodUpdateMediumtextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeMediumtext::class, $response); } - public function testMethodCreatePointAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1180,7 +1141,7 @@ public function testMethodCreatePointAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1198,10 +1159,9 @@ public function testMethodCreatePointAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributePoint::class, $response); } - public function testMethodUpdatePointAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1209,7 +1169,7 @@ public function testMethodUpdatePointAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1227,10 +1187,9 @@ public function testMethodUpdatePointAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributePoint::class, $response); } - public function testMethodCreatePolygonAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1238,7 +1197,7 @@ public function testMethodCreatePolygonAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1256,10 +1215,9 @@ public function testMethodCreatePolygonAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributePolygon::class, $response); } - public function testMethodUpdatePolygonAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1267,7 +1225,7 @@ public function testMethodUpdatePolygonAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1285,10 +1243,9 @@ public function testMethodUpdatePolygonAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributePolygon::class, $response); } - public function testMethodCreateRelationshipAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1302,7 +1259,7 @@ public function testMethodCreateRelationshipAttribute(): void "twoWayKey" => "string", "onDelete" => "restrict|cascade|setNull", "side" => "parent|child" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1320,10 +1277,9 @@ public function testMethodCreateRelationshipAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeRelationship::class, $response); } - public function testMethodUpdateRelationshipAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1337,7 +1293,7 @@ public function testMethodUpdateRelationshipAttribute(): void "twoWayKey" => "string", "onDelete" => "restrict|cascade|setNull", "side" => "parent|child" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1354,10 +1310,9 @@ public function testMethodUpdateRelationshipAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeRelationship::class, $response); } - public function testMethodCreateStringAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1366,7 +1321,7 @@ public function testMethodCreateStringAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1385,10 +1340,9 @@ public function testMethodCreateStringAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeString::class, $response); } - public function testMethodUpdateStringAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1397,7 +1351,7 @@ public function testMethodUpdateStringAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1416,10 +1370,9 @@ public function testMethodUpdateStringAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeString::class, $response); } - public function testMethodCreateTextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1427,7 +1380,7 @@ public function testMethodCreateTextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1445,10 +1398,9 @@ public function testMethodCreateTextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeText::class, $response); } - public function testMethodUpdateTextAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1456,7 +1408,7 @@ public function testMethodUpdateTextAttribute(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1475,10 +1427,9 @@ public function testMethodUpdateTextAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeText::class, $response); } - public function testMethodCreateUrlAttribute(): void { - $data = array( + $data = [ "key" => "githubUrl", "type" => "string", "status" => "available", @@ -1487,7 +1438,7 @@ public function testMethodCreateUrlAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1505,10 +1456,9 @@ public function testMethodCreateUrlAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeUrl::class, $response); } - public function testMethodUpdateUrlAttribute(): void { - $data = array( + $data = [ "key" => "githubUrl", "type" => "string", "status" => "available", @@ -1517,7 +1467,7 @@ public function testMethodUpdateUrlAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1536,10 +1486,9 @@ public function testMethodUpdateUrlAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeUrl::class, $response); } - public function testMethodCreateVarcharAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1548,7 +1497,7 @@ public function testMethodCreateVarcharAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1567,10 +1516,9 @@ public function testMethodCreateVarcharAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeVarchar::class, $response); } - public function testMethodUpdateVarcharAttribute(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1579,7 +1527,7 @@ public function testMethodUpdateVarcharAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1598,11 +1546,10 @@ public function testMethodUpdateVarcharAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeVarchar::class, $response); } - public function testMethodGetAttribute(): void { $data = array_replace( - array( + [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1611,10 +1558,10 @@ public function testMethodGetAttribute(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ), - array( + ], + [ "type" => "string" - ) + ] ); $this->client @@ -1632,7 +1579,6 @@ public function testMethodGetAttribute(): void $this->assertInstanceOf(\Appwrite\Models\AttributeString::class, $response); } - public function testMethodDeleteAttribute(): void { $data = ''; @@ -1652,23 +1598,22 @@ public function testMethodDeleteAttribute(): void $this->assertSame($data, $response); } - public function testMethodListDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1684,18 +1629,17 @@ public function testMethodListDocuments(): void $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodCreateDocument(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1708,28 +1652,27 @@ public function testMethodCreateDocument(): void "", "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodCreateDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1741,28 +1684,27 @@ public function testMethodCreateDocuments(): void $response = $this->databases->createDocuments( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodUpsertDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1774,28 +1716,27 @@ public function testMethodUpsertDocuments(): void $response = $this->databases->upsertDocuments( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodUpdateDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1811,23 +1752,22 @@ public function testMethodUpdateDocuments(): void $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodDeleteDocuments(): void { - $data = array( + $data = [ "total" => 5, - "documents" => array( - array( + "documents" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1843,18 +1783,17 @@ public function testMethodDeleteDocuments(): void $this->assertInstanceOf(\Appwrite\Models\DocumentList::class, $response); } - public function testMethodGetDocument(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1871,18 +1810,17 @@ public function testMethodGetDocument(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodUpsertDocument(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1899,18 +1837,17 @@ public function testMethodUpsertDocument(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodUpdateDocument(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1927,7 +1864,6 @@ public function testMethodUpdateDocument(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodDeleteDocument(): void { $data = ''; @@ -1947,18 +1883,17 @@ public function testMethodDeleteDocument(): void $this->assertSame($data, $response); } - public function testMethodDecrementDocumentAttribute(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1976,18 +1911,17 @@ public function testMethodDecrementDocumentAttribute(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodIncrementDocumentAttribute(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$collectionId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2005,13 +1939,12 @@ public function testMethodIncrementDocumentAttribute(): void $this->assertInstanceOf(\Appwrite\Models\Document::class, $response); } - public function testMethodListIndexes(): void { - $data = array( + $data = [ "total" => 5, - "indexes" => array( - array( + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2019,11 +1952,11 @@ public function testMethodListIndexes(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ) - ) - ); + "attributes" => [], + "lengths" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2039,10 +1972,9 @@ public function testMethodListIndexes(): void $this->assertInstanceOf(\Appwrite\Models\IndexList::class, $response); } - public function testMethodCreateIndex(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2050,9 +1982,9 @@ public function testMethodCreateIndex(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ); + "attributes" => [], + "lengths" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2066,15 +1998,14 @@ public function testMethodCreateIndex(): void "", "", DatabasesIndexType::KEY(), - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Index::class, $response); } - public function testMethodGetIndex(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2082,9 +2013,9 @@ public function testMethodGetIndex(): void "type" => "primary", "status" => "available", "error" => "string", - "attributes" => array(), - "lengths" => array() - ); + "attributes" => [], + "lengths" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2101,7 +2032,6 @@ public function testMethodGetIndex(): void $this->assertInstanceOf(\Appwrite\Models\Index::class, $response); } - public function testMethodDeleteIndex(): void { $data = ''; @@ -2121,5 +2051,4 @@ public function testMethodDeleteIndex(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/EmbeddingsTest.php b/tests/Appwrite/Services/EmbeddingsTest.php index e7717667..b6595dae 100644 --- a/tests/Appwrite/Services/EmbeddingsTest.php +++ b/tests/Appwrite/Services/EmbeddingsTest.php @@ -1,17 +1,18 @@ 5, - "embeddings" => array( - array( + "embeddings" => [ + [ "model" => "nomic-embed-text", "dimension" => 768, - "embedding" => array(), + "embedding" => [], "error" => "Error message" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -41,10 +42,9 @@ public function testMethodCreateTextEmbeddings(): void ->andReturn(''); $response = $this->embeddings->createTextEmbeddings( - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\EmbeddingList::class, $response); } - } diff --git a/tests/Appwrite/Services/FunctionsTest.php b/tests/Appwrite/Services/FunctionsTest.php index 680d897c..edb42660 100644 --- a/tests/Appwrite/Services/FunctionsTest.php +++ b/tests/Appwrite/Services/FunctionsTest.php @@ -1,22 +1,22 @@ 5, - "functions" => array( - array( + "functions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -45,9 +45,9 @@ public function testMethodList(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -56,9 +56,9 @@ public function testMethodList(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -69,13 +69,13 @@ public function testMethodList(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -88,14 +88,13 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\FunctionList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -107,9 +106,9 @@ public function testMethodCreate(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -118,9 +117,9 @@ public function testMethodCreate(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -131,11 +130,11 @@ public function testMethodCreate(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -152,13 +151,12 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); } - public function testMethodListRuntimes(): void { - $data = array( + $data = [ "total" => 5, - "runtimes" => array( - array( + "runtimes" => [ + [ "\$id" => "python-3.8", "key" => "python", "name" => "Python", @@ -166,10 +164,10 @@ public function testMethodListRuntimes(): void "base" => "python:3.8-alpine", "image" => "appwrite\\/runtime-for-python:3.8", "logo" => "python.png", - "supports" => array() - ) - ) - ); + "supports" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -182,20 +180,19 @@ public function testMethodListRuntimes(): void $this->assertInstanceOf(\Appwrite\Models\RuntimeList::class, $response); } - public function testMethodListSpecifications(): void { - $data = array( + $data = [ "total" => 5, - "specifications" => array( - array( + "specifications" => [ + [ "memory" => 512, "cpus" => 1, "enabled" => true, "slug" => "s-1vcpu-512mb" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -208,14 +205,13 @@ public function testMethodListSpecifications(): void $this->assertInstanceOf(\Appwrite\Models\SpecificationList::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -227,9 +223,9 @@ public function testMethodGet(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -238,9 +234,9 @@ public function testMethodGet(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -251,11 +247,11 @@ public function testMethodGet(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -270,14 +266,13 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -289,9 +284,9 @@ public function testMethodUpdate(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -300,9 +295,9 @@ public function testMethodUpdate(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -313,11 +308,11 @@ public function testMethodUpdate(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -333,7 +328,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -351,14 +345,13 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateFunctionDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "execute" => array(), + "execute" => [], "name" => "My Function", "enabled" => true, "live" => true, @@ -370,9 +363,9 @@ public function testMethodUpdateFunctionDeployment(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "scopes" => array(), - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -381,9 +374,9 @@ public function testMethodUpdateFunctionDeployment(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), - "events" => array(), + ] + ], + "events" => [], "schedule" => "5 4 * * *", "timeout" => 300, "entrypoint" => "index.js", @@ -394,11 +387,11 @@ public function testMethodUpdateFunctionDeployment(): void "providerBranch" => "main", "providerRootDirectory" => "functions/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -414,13 +407,12 @@ public function testMethodUpdateFunctionDeployment(): void $this->assertInstanceOf(\Appwrite\Models\FunctionModel::class, $response); } - public function testMethodListDeployments(): void { - $data = array( + $data = [ "total" => 5, - "deployments" => array( - array( + "deployments" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -448,9 +440,9 @@ public function testMethodListDeployments(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -465,10 +457,9 @@ public function testMethodListDeployments(): void $this->assertInstanceOf(\Appwrite\Models\DeploymentList::class, $response); } - public function testMethodCreateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -496,7 +487,7 @@ public function testMethodCreateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -513,10 +504,9 @@ public function testMethodCreateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateDuplicateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -544,7 +534,7 @@ public function testMethodCreateDuplicateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -560,10 +550,9 @@ public function testMethodCreateDuplicateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateTemplateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -591,7 +580,7 @@ public function testMethodCreateTemplateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -611,10 +600,9 @@ public function testMethodCreateTemplateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateVcsDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -642,7 +630,7 @@ public function testMethodCreateVcsDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -659,10 +647,9 @@ public function testMethodCreateVcsDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodGetDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -690,7 +677,7 @@ public function testMethodGetDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -706,7 +693,6 @@ public function testMethodGetDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodDeleteDeployment(): void { $data = ''; @@ -725,7 +711,6 @@ public function testMethodDeleteDeployment(): void $this->assertSame($data, $response); } - public function testMethodGetDeploymentDownload(): void { $data = ''; @@ -744,10 +729,9 @@ public function testMethodGetDeploymentDownload(): void $this->assertSame($data, $response); } - public function testMethodUpdateDeploymentStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -775,7 +759,7 @@ public function testMethodUpdateDeploymentStatus(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -791,43 +775,43 @@ public function testMethodUpdateDeploymentStatus(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodListExecutions(): void { - $data = array( + $data = [ "total" => 5, - "executions" => array( - array( + "executions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -842,38 +826,38 @@ public function testMethodListExecutions(): void $this->assertInstanceOf(\Appwrite\Models\ExecutionList::class, $response); } - public function testMethodCreateExecution(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -888,38 +872,38 @@ public function testMethodCreateExecution(): void $this->assertInstanceOf(\Appwrite\Models\Execution::class, $response); } - public function testMethodGetExecution(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -935,7 +919,6 @@ public function testMethodGetExecution(): void $this->assertInstanceOf(\Appwrite\Models\Execution::class, $response); } - public function testMethodDeleteExecution(): void { $data = ''; @@ -954,13 +937,12 @@ public function testMethodDeleteExecution(): void $this->assertSame($data, $response); } - public function testMethodListVariables(): void { - $data = array( + $data = [ "total" => 5, - "variables" => array( - array( + "variables" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -969,9 +951,9 @@ public function testMethodListVariables(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -986,10 +968,9 @@ public function testMethodListVariables(): void $this->assertInstanceOf(\Appwrite\Models\VariableList::class, $response); } - public function testMethodCreateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -998,7 +979,7 @@ public function testMethodCreateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1010,16 +991,15 @@ public function testMethodCreateVariable(): void $response = $this->functions->createVariable( "", "", - "", + "", "" ); $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodGetVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1028,7 +1008,7 @@ public function testMethodGetVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1044,10 +1024,9 @@ public function testMethodGetVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodUpdateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1056,7 +1035,7 @@ public function testMethodUpdateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1072,7 +1051,6 @@ public function testMethodUpdateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodDeleteVariable(): void { $data = ''; @@ -1091,5 +1069,4 @@ public function testMethodDeleteVariable(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/GraphqlTest.php b/tests/Appwrite/Services/GraphqlTest.php index 19898d95..704a78ac 100644 --- a/tests/Appwrite/Services/GraphqlTest.php +++ b/tests/Appwrite/Services/GraphqlTest.php @@ -1,16 +1,18 @@ client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -30,15 +32,14 @@ public function testMethodQuery(): void ->andReturn(''); $response = $this->graphql->query( - array() + [] ); $this->assertSame($data, $response); } - public function testMethodMutation(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -48,10 +49,9 @@ public function testMethodMutation(): void ->andReturn(''); $response = $this->graphql->mutation( - array() + [] ); $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/LocaleTest.php b/tests/Appwrite/Services/LocaleTest.php index fff451b3..03844de9 100644 --- a/tests/Appwrite/Services/LocaleTest.php +++ b/tests/Appwrite/Services/LocaleTest.php @@ -1,16 +1,18 @@ "127.0.0.1", "countryCode" => "US", "country" => "United States", @@ -28,7 +30,7 @@ public function testMethodGet(): void "continent" => "North America", "eu" => true, "currency" => "USD" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -41,18 +43,17 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Locale::class, $response); } - public function testMethodListCodes(): void { - $data = array( + $data = [ "total" => 5, - "localeCodes" => array( - array( + "localeCodes" => [ + [ "code" => "en-us", "name" => "US" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -65,18 +66,17 @@ public function testMethodListCodes(): void $this->assertInstanceOf(\Appwrite\Models\LocaleCodeList::class, $response); } - public function testMethodListContinents(): void { - $data = array( + $data = [ "total" => 5, - "continents" => array( - array( + "continents" => [ + [ "name" => "Europe", "code" => "EU" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -89,18 +89,17 @@ public function testMethodListContinents(): void $this->assertInstanceOf(\Appwrite\Models\ContinentList::class, $response); } - public function testMethodListCountries(): void { - $data = array( + $data = [ "total" => 5, - "countries" => array( - array( + "countries" => [ + [ "name" => "United States", "code" => "US" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -113,18 +112,17 @@ public function testMethodListCountries(): void $this->assertInstanceOf(\Appwrite\Models\CountryList::class, $response); } - public function testMethodListCountriesEU(): void { - $data = array( + $data = [ "total" => 5, - "countries" => array( - array( + "countries" => [ + [ "name" => "United States", "code" => "US" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -137,19 +135,18 @@ public function testMethodListCountriesEU(): void $this->assertInstanceOf(\Appwrite\Models\CountryList::class, $response); } - public function testMethodListCountriesPhones(): void { - $data = array( + $data = [ "total" => 5, - "phones" => array( - array( + "phones" => [ + [ "code" => "+1", "countryCode" => "US", "countryName" => "United States" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -162,13 +159,12 @@ public function testMethodListCountriesPhones(): void $this->assertInstanceOf(\Appwrite\Models\PhoneList::class, $response); } - public function testMethodListCurrencies(): void { - $data = array( + $data = [ "total" => 5, - "currencies" => array( - array( + "currencies" => [ + [ "symbol" => "\$", "name" => "US dollar", "symbolNative" => "\$", @@ -176,9 +172,9 @@ public function testMethodListCurrencies(): void "rounding" => 0, "code" => "USD", "namePlural" => "US dollars" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -191,19 +187,18 @@ public function testMethodListCurrencies(): void $this->assertInstanceOf(\Appwrite\Models\CurrencyList::class, $response); } - public function testMethodListLanguages(): void { - $data = array( + $data = [ "total" => 5, - "languages" => array( - array( + "languages" => [ + [ "name" => "Italian", "code" => "it", "nativeName" => "Italiano" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -216,5 +211,4 @@ public function testMethodListLanguages(): void $this->assertInstanceOf(\Appwrite\Models\LanguageList::class, $response); } - } diff --git a/tests/Appwrite/Services/MessagingTest.php b/tests/Appwrite/Services/MessagingTest.php index 2c51919a..3ba423ce 100644 --- a/tests/Appwrite/Services/MessagingTest.php +++ b/tests/Appwrite/Services/MessagingTest.php @@ -1,18 +1,18 @@ 5, - "messages" => array( - array( + "messages" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -51,21 +51,20 @@ public function testMethodListMessages(): void $this->assertInstanceOf(\Appwrite\Models\MessageList::class, $response); } - public function testMethodCreateEmail(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -82,21 +81,20 @@ public function testMethodCreateEmail(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodUpdateEmail(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -111,21 +109,20 @@ public function testMethodUpdateEmail(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodCreatePush(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -140,21 +137,20 @@ public function testMethodCreatePush(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodUpdatePush(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -169,21 +165,20 @@ public function testMethodUpdatePush(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodCreateSMS(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -199,21 +194,20 @@ public function testMethodCreateSMS(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodUpdateSMS(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -228,21 +222,20 @@ public function testMethodUpdateSMS(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodGetMessage(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "providerType" => "email", - "topics" => array(), - "users" => array(), - "targets" => array(), + "topics" => [], + "users" => [], + "targets" => [], "deliveredTotal" => 1, - "data" => array(), + "data" => [], "status" => "draft" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -257,7 +250,6 @@ public function testMethodGetMessage(): void $this->assertInstanceOf(\Appwrite\Models\Message::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -275,13 +267,12 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListTargets(): void { - $data = array( + $data = [ "total" => 5, - "targets" => array( - array( + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -290,9 +281,9 @@ public function testMethodListTargets(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -307,13 +298,12 @@ public function testMethodListTargets(): void $this->assertInstanceOf(\Appwrite\Models\TargetList::class, $response); } - public function testMethodListProviders(): void { - $data = array( + $data = [ "total" => 5, - "providers" => array( - array( + "providers" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -321,10 +311,10 @@ public function testMethodListProviders(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ) - ) - ); + "credentials" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -337,10 +327,9 @@ public function testMethodListProviders(): void $this->assertInstanceOf(\Appwrite\Models\ProviderList::class, $response); } - public function testMethodCreateAPNSProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -348,8 +337,8 @@ public function testMethodCreateAPNSProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -365,10 +354,9 @@ public function testMethodCreateAPNSProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateAPNSProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -376,8 +364,8 @@ public function testMethodUpdateAPNSProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -392,10 +380,9 @@ public function testMethodUpdateAPNSProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateFCMProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -403,8 +390,8 @@ public function testMethodCreateFCMProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -420,10 +407,9 @@ public function testMethodCreateFCMProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateFCMProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -431,8 +417,8 @@ public function testMethodUpdateFCMProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -447,10 +433,9 @@ public function testMethodUpdateFCMProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateMailgunProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -458,8 +443,8 @@ public function testMethodCreateMailgunProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -475,10 +460,9 @@ public function testMethodCreateMailgunProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateMailgunProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -486,8 +470,8 @@ public function testMethodUpdateMailgunProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -502,10 +486,9 @@ public function testMethodUpdateMailgunProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateMsg91Provider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -513,8 +496,8 @@ public function testMethodCreateMsg91Provider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -530,10 +513,9 @@ public function testMethodCreateMsg91Provider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateMsg91Provider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -541,8 +523,8 @@ public function testMethodUpdateMsg91Provider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -557,10 +539,9 @@ public function testMethodUpdateMsg91Provider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateResendProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -568,8 +549,8 @@ public function testMethodCreateResendProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -585,10 +566,9 @@ public function testMethodCreateResendProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateResendProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -596,8 +576,8 @@ public function testMethodUpdateResendProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -612,10 +592,9 @@ public function testMethodUpdateResendProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateSendgridProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -623,8 +602,8 @@ public function testMethodCreateSendgridProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -640,10 +619,9 @@ public function testMethodCreateSendgridProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateSendgridProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -651,8 +629,8 @@ public function testMethodUpdateSendgridProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -667,10 +645,9 @@ public function testMethodUpdateSendgridProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateSesProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -678,8 +655,8 @@ public function testMethodCreateSesProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -695,10 +672,9 @@ public function testMethodCreateSesProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateSesProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -706,8 +682,8 @@ public function testMethodUpdateSesProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -722,10 +698,9 @@ public function testMethodUpdateSesProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateSMTPProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -733,8 +708,8 @@ public function testMethodCreateSMTPProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -751,10 +726,9 @@ public function testMethodCreateSMTPProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateSMTPProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -762,8 +736,8 @@ public function testMethodUpdateSMTPProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -778,10 +752,9 @@ public function testMethodUpdateSMTPProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateTelesignProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -789,8 +762,8 @@ public function testMethodCreateTelesignProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -806,10 +779,9 @@ public function testMethodCreateTelesignProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateTelesignProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -817,8 +789,8 @@ public function testMethodUpdateTelesignProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -833,10 +805,9 @@ public function testMethodUpdateTelesignProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateTextmagicProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -844,8 +815,8 @@ public function testMethodCreateTextmagicProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -861,10 +832,9 @@ public function testMethodCreateTextmagicProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateTextmagicProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -872,8 +842,8 @@ public function testMethodUpdateTextmagicProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -888,10 +858,9 @@ public function testMethodUpdateTextmagicProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateTwilioProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -899,8 +868,8 @@ public function testMethodCreateTwilioProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -916,10 +885,9 @@ public function testMethodCreateTwilioProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateTwilioProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -927,8 +895,8 @@ public function testMethodUpdateTwilioProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -943,10 +911,9 @@ public function testMethodUpdateTwilioProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodCreateVonageProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -954,8 +921,8 @@ public function testMethodCreateVonageProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -971,10 +938,9 @@ public function testMethodCreateVonageProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodUpdateVonageProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -982,8 +948,8 @@ public function testMethodUpdateVonageProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -998,10 +964,9 @@ public function testMethodUpdateVonageProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodGetProvider(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1009,8 +974,8 @@ public function testMethodGetProvider(): void "provider" => "mailgun", "enabled" => true, "type" => "sms", - "credentials" => array() - ); + "credentials" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1025,7 +990,6 @@ public function testMethodGetProvider(): void $this->assertInstanceOf(\Appwrite\Models\Provider::class, $response); } - public function testMethodDeleteProvider(): void { $data = ''; @@ -1043,13 +1007,12 @@ public function testMethodDeleteProvider(): void $this->assertSame($data, $response); } - public function testMethodListTopics(): void { - $data = array( + $data = [ "total" => 5, - "topics" => array( - array( + "topics" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1057,10 +1020,10 @@ public function testMethodListTopics(): void "emailTotal" => 100, "smsTotal" => 100, "pushTotal" => 100, - "subscribe" => array() - ) - ) - ); + "subscribe" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1073,10 +1036,9 @@ public function testMethodListTopics(): void $this->assertInstanceOf(\Appwrite\Models\TopicList::class, $response); } - public function testMethodCreateTopic(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1084,8 +1046,8 @@ public function testMethodCreateTopic(): void "emailTotal" => 100, "smsTotal" => 100, "pushTotal" => 100, - "subscribe" => array() - ); + "subscribe" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1101,10 +1063,9 @@ public function testMethodCreateTopic(): void $this->assertInstanceOf(\Appwrite\Models\Topic::class, $response); } - public function testMethodGetTopic(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1112,8 +1073,8 @@ public function testMethodGetTopic(): void "emailTotal" => 100, "smsTotal" => 100, "pushTotal" => 100, - "subscribe" => array() - ); + "subscribe" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1128,10 +1089,9 @@ public function testMethodGetTopic(): void $this->assertInstanceOf(\Appwrite\Models\Topic::class, $response); } - public function testMethodUpdateTopic(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1139,8 +1099,8 @@ public function testMethodUpdateTopic(): void "emailTotal" => 100, "smsTotal" => 100, "pushTotal" => 100, - "subscribe" => array() - ); + "subscribe" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1155,7 +1115,6 @@ public function testMethodUpdateTopic(): void $this->assertInstanceOf(\Appwrite\Models\Topic::class, $response); } - public function testMethodDeleteTopic(): void { $data = ''; @@ -1173,18 +1132,17 @@ public function testMethodDeleteTopic(): void $this->assertSame($data, $response); } - public function testMethodListSubscribers(): void { - $data = array( + $data = [ "total" => 5, - "subscribers" => array( - array( + "subscribers" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "targetId" => "259125845563242502", - "target" => array( + "target" => [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1193,14 +1151,14 @@ public function testMethodListSubscribers(): void "providerType" => "email", "identifier" => "token", "expired" => true - ), + ], "userId" => "5e5ea5c16897e", "userName" => "Aegon Targaryen", "topicId" => "259125845563242502", "providerType" => "email" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1215,15 +1173,14 @@ public function testMethodListSubscribers(): void $this->assertInstanceOf(\Appwrite\Models\SubscriberList::class, $response); } - public function testMethodCreateSubscriber(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "targetId" => "259125845563242502", - "target" => array( + "target" => [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1232,12 +1189,12 @@ public function testMethodCreateSubscriber(): void "providerType" => "email", "identifier" => "token", "expired" => true - ), + ], "userId" => "5e5ea5c16897e", "userName" => "Aegon Targaryen", "topicId" => "259125845563242502", "providerType" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1254,15 +1211,14 @@ public function testMethodCreateSubscriber(): void $this->assertInstanceOf(\Appwrite\Models\Subscriber::class, $response); } - public function testMethodGetSubscriber(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "targetId" => "259125845563242502", - "target" => array( + "target" => [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1271,12 +1227,12 @@ public function testMethodGetSubscriber(): void "providerType" => "email", "identifier" => "token", "expired" => true - ), + ], "userId" => "5e5ea5c16897e", "userName" => "Aegon Targaryen", "topicId" => "259125845563242502", "providerType" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1292,7 +1248,6 @@ public function testMethodGetSubscriber(): void $this->assertInstanceOf(\Appwrite\Models\Subscriber::class, $response); } - public function testMethodDeleteSubscriber(): void { $data = ''; @@ -1311,5 +1266,4 @@ public function testMethodDeleteSubscriber(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/Oauth2Test.php b/tests/Appwrite/Services/Oauth2Test.php index 3bf122fc..bfff4992 100644 --- a/tests/Appwrite/Services/Oauth2Test.php +++ b/tests/Appwrite/Services/Oauth2Test.php @@ -1,16 +1,18 @@ "https://example.com/callback?code=abcde&state=fghij" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -37,13 +39,12 @@ public function testMethodApprove(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Approve::class, $response); } - public function testMethodAuthorize(): void { - $data = array( + $data = [ "grantId" => "5e5ea5c16897e", "redirectUrl" => "https://example.com/callback?code=abcde&state=fghij" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -56,13 +57,12 @@ public function testMethodAuthorize(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Authorize::class, $response); } - public function testMethodAuthorizePost(): void { - $data = array( + $data = [ "grantId" => "5e5ea5c16897e", "redirectUrl" => "https://example.com/callback?code=abcde&state=fghij" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -75,17 +75,16 @@ public function testMethodAuthorizePost(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Authorize::class, $response); } - public function testMethodCreateDeviceAuthorization(): void { - $data = array( + $data = [ "device_code" => "5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a", "user_code" => "ABCD-EFGH", "verification_uri" => "https://cloud.appwrite.io/console/oauth2/device", "verification_uri_complete" => "https://cloud.appwrite.io/console/oauth2/device?user_code=ABCD-EFGH", "expires_in" => 900, "interval" => 5 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -98,23 +97,22 @@ public function testMethodCreateDeviceAuthorization(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2DeviceAuthorization::class, $response); } - public function testMethodCreateGrant(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "prompt" => "login", "redirectUri" => "https://example.com/callback", "authTime" => 1592981250, "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -129,23 +127,22 @@ public function testMethodCreateGrant(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Grant::class, $response); } - public function testMethodGetGrant(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c16897e", "appId" => "5e5ea5c16897e", - "scopes" => array(), - "resources" => array(), + "scopes" => [], + "resources" => [], "authorizationDetails" => "[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]", "prompt" => "login", "redirectUri" => "https://example.com/callback", "authTime" => 1592981250, "expire" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -160,17 +157,16 @@ public function testMethodGetGrant(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Grant::class, $response); } - public function testMethodListOrganizations(): void { - $data = array( + $data = [ "total" => 5, - "organizations" => array( - array( + "organizations" => [ + [ "\$id" => "5e5ea5c16897e" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -183,13 +179,12 @@ public function testMethodListOrganizations(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2OrganizationList::class, $response); } - public function testMethodCreatePAR(): void { - $data = array( + $data = [ "request_uri" => "urn:appwrite:oauth2:request:5e5ea5c16897e", "expires_in" => 600 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -206,19 +201,18 @@ public function testMethodCreatePAR(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2PAR::class, $response); } - public function testMethodListProjects(): void { - $data = array( + $data = [ "total" => 5, - "projects" => array( - array( + "projects" => [ + [ "\$id" => "5e5ea5c16897e", "region" => "fra", "endpoint" => "https://fra.cloud.appwrite.io/v1" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -231,12 +225,11 @@ public function testMethodListProjects(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2ProjectList::class, $response); } - public function testMethodReject(): void { - $data = array( + $data = [ "redirectUrl" => "https://example.com/callback?error=access_denied&state=fghij" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -251,10 +244,9 @@ public function testMethodReject(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Reject::class, $response); } - public function testMethodRevoke(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -269,16 +261,15 @@ public function testMethodRevoke(): void $this->assertSame($data, $response); } - public function testMethodCreateToken(): void { - $data = array( + $data = [ "access_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...", "token_type" => "Bearer", "expires_in" => 3600, "refresh_token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "scope" => "openid email profile" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -293,5 +284,4 @@ public function testMethodCreateToken(): void $this->assertInstanceOf(\Appwrite\Models\Oauth2Token::class, $response); } - } diff --git a/tests/Appwrite/Services/OrganizationTest.php b/tests/Appwrite/Services/OrganizationTest.php index 9d24d59c..b60dcc80 100644 --- a/tests/Appwrite/Services/OrganizationTest.php +++ b/tests/Appwrite/Services/OrganizationTest.php @@ -1,18 +1,19 @@ "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array(), - "budgetAlerts" => array(), + "prefs" => [], + "budgetAlerts" => [], "billingPlan" => "tier-1", "billingPlanId" => "tier-1", - "billingPlanDetails" => array( + "billingPlanDetails" => [ "\$id" => "tier-0", "name" => "Hobby", "desc" => "Hobby plan", @@ -69,73 +70,73 @@ public function testMethodGet(): void "usageLogs" => 30, "projectInactivityDays" => 7, "alertLimit" => 80, - "usage" => array( - "bandwidth" => array( + "usage" => [ + "bandwidth" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "executions" => array( + ], + "executions" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "realtime" => array( + ], + "realtime" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "realtimeMessages" => array( + ], + "realtimeMessages" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "storage" => array( + ], + "storage" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "users" => array( + ], + "users" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "GBHours" => array( + ], + "GBHours" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "imageTransformations" => array( + ], + "imageTransformations" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ) - ), - "addons" => array(), + ] + ], + "addons" => [], "budgetCapEnabled" => true, "customSmtp" => true, "emailBranding" => true, @@ -148,22 +149,24 @@ public function testMethodGet(): void "supportsMockNumbers" => true, "supportsOrganizationRoles" => true, "supportsCredits" => true, + "supportsDedicatedDatabases" => true, "supportsDisposableEmailValidation" => true, "supportsCanonicalEmailValidation" => true, "supportsFreeEmailValidation" => true, "supportsCorporateEmailValidation" => true, "supportsProjectSpecificRoles" => true, "usagePerProject" => true, - "supportedAddons" => array( + "supportedAddons" => [ "baa" => true, "premiumGeoDB" => true, "premiumGeoDBOrg" => true - ), + ], "deploymentSize" => 30, "buildSize" => 2000, "databasesAllowEncrypt" => true, - "group" => "starter" - ), + "group" => "starter", + "databaseComputeCredit" => 10 + ], "billingEmail" => "billing@org.example", "billingStartDate" => "2020-10-15T06:38:00.000+00:00", "billingCurrentInvoiceDate" => "2020-10-15T06:38:00.000+00:00", @@ -175,8 +178,8 @@ public function testMethodGet(): void "status" => "active", "markedForDeletion" => true, "platform" => "imagine", - "projects" => array() - ); + "projects" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -189,20 +192,19 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Organization::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array(), - "budgetAlerts" => array(), + "prefs" => [], + "budgetAlerts" => [], "billingPlan" => "tier-1", "billingPlanId" => "tier-1", - "billingPlanDetails" => array( + "billingPlanDetails" => [ "\$id" => "tier-0", "name" => "Hobby", "desc" => "Hobby plan", @@ -239,73 +241,73 @@ public function testMethodUpdate(): void "usageLogs" => 30, "projectInactivityDays" => 7, "alertLimit" => 80, - "usage" => array( - "bandwidth" => array( + "usage" => [ + "bandwidth" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "executions" => array( + ], + "executions" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "realtime" => array( + ], + "realtime" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "realtimeMessages" => array( + ], + "realtimeMessages" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "storage" => array( + ], + "storage" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "users" => array( + ], + "users" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "GBHours" => array( + ], + "GBHours" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ), - "imageTransformations" => array( + ], + "imageTransformations" => [ "name" => "[NAME]", "unit" => "GB", "currency" => "USD", "price" => 5, "value" => 25, "invoiceDesc" => "[INVOICEDESC]" - ) - ), - "addons" => array(), + ] + ], + "addons" => [], "budgetCapEnabled" => true, "customSmtp" => true, "emailBranding" => true, @@ -318,22 +320,24 @@ public function testMethodUpdate(): void "supportsMockNumbers" => true, "supportsOrganizationRoles" => true, "supportsCredits" => true, + "supportsDedicatedDatabases" => true, "supportsDisposableEmailValidation" => true, "supportsCanonicalEmailValidation" => true, "supportsFreeEmailValidation" => true, "supportsCorporateEmailValidation" => true, "supportsProjectSpecificRoles" => true, "usagePerProject" => true, - "supportedAddons" => array( + "supportedAddons" => [ "baa" => true, "premiumGeoDB" => true, "premiumGeoDBOrg" => true - ), + ], "deploymentSize" => 30, "buildSize" => 2000, "databasesAllowEncrypt" => true, - "group" => "starter" - ), + "group" => "starter", + "databaseComputeCredit" => 10 + ], "billingEmail" => "billing@org.example", "billingStartDate" => "2020-10-15T06:38:00.000+00:00", "billingCurrentInvoiceDate" => "2020-10-15T06:38:00.000+00:00", @@ -345,8 +349,8 @@ public function testMethodUpdate(): void "status" => "active", "markedForDeletion" => true, "platform" => "imagine", - "projects" => array() - ); + "projects" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -361,7 +365,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Organization::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -377,25 +380,24 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListInstallations(): void { - $data = array( + $data = [ "total" => 5, - "installations" => array( - array( + "installations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -408,20 +410,19 @@ public function testMethodListInstallations(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); } - public function testMethodCreateInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -436,20 +437,19 @@ public function testMethodCreateInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodGetInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -464,20 +464,19 @@ public function testMethodGetInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodUpdateInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -492,7 +491,6 @@ public function testMethodUpdateInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodDeleteInstallation(): void { $data = ''; @@ -510,25 +508,24 @@ public function testMethodDeleteInstallation(): void $this->assertSame($data, $response); } - public function testMethodListKeys(): void { - $data = array( + $data = [ "total" => 5, - "keys" => array( - array( + "keys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ) - ); + "sdks" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -541,20 +538,19 @@ public function testMethodListKeys(): void $this->assertInstanceOf(\Appwrite\Models\KeyList::class, $response); } - public function testMethodCreateKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -566,25 +562,24 @@ public function testMethodCreateKey(): void $response = $this->organization->createKey( "", "", - array(OrganizationKeyScopes::PROJECTSREAD()) + [OrganizationKeyScopes::PROJECTSREAD()] ); $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodGetKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -599,20 +594,19 @@ public function testMethodGetKey(): void $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodUpdateKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -624,12 +618,11 @@ public function testMethodUpdateKey(): void $response = $this->organization->updateKey( "", "", - array(OrganizationKeyScopes::PROJECTSREAD()) + [OrganizationKeyScopes::PROJECTSREAD()] ); $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodDeleteKey(): void { $data = ''; @@ -647,13 +640,12 @@ public function testMethodDeleteKey(): void $this->assertSame($data, $response); } - public function testMethodListMemberships(): void { - $data = array( + $data = [ "total" => 5, - "memberships" => array( - array( + "memberships" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -668,10 +660,10 @@ public function testMethodListMemberships(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ) - ) - ); + "roles" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -684,10 +676,9 @@ public function testMethodListMemberships(): void $this->assertInstanceOf(\Appwrite\Models\MembershipList::class, $response); } - public function testMethodCreateMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -702,8 +693,8 @@ public function testMethodCreateMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -713,15 +704,14 @@ public function testMethodCreateMembership(): void ->andReturn(''); $response = $this->organization->createMembership( - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodGetMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -736,8 +726,8 @@ public function testMethodGetMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -752,10 +742,9 @@ public function testMethodGetMembership(): void $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodUpdateMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -770,8 +759,8 @@ public function testMethodUpdateMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -782,12 +771,11 @@ public function testMethodUpdateMembership(): void $response = $this->organization->updateMembership( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodDeleteMembership(): void { $data = ''; @@ -805,21 +793,20 @@ public function testMethodDeleteMembership(): void $this->assertSame($data, $response); } - public function testMethodListProjects(): void { - $data = array( + $data = [ "total" => 5, - "projects" => array( - array( + "projects" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -827,9 +814,9 @@ public function testMethodListProjects(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -842,29 +829,29 @@ public function testMethodListProjects(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -874,13 +861,12 @@ public function testMethodListProjects(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ) - ) - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -893,18 +879,17 @@ public function testMethodListProjects(): void $this->assertInstanceOf(\Appwrite\Models\ProjectList::class, $response); } - public function testMethodCreateProject(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -912,9 +897,9 @@ public function testMethodCreateProject(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -927,29 +912,29 @@ public function testMethodCreateProject(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -959,11 +944,10 @@ public function testMethodCreateProject(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -979,18 +963,17 @@ public function testMethodCreateProject(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodGetProject(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -998,9 +981,9 @@ public function testMethodGetProject(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -1013,29 +996,29 @@ public function testMethodGetProject(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -1045,11 +1028,10 @@ public function testMethodGetProject(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1064,18 +1046,17 @@ public function testMethodGetProject(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateProject(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1083,9 +1064,9 @@ public function testMethodUpdateProject(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -1098,29 +1079,29 @@ public function testMethodUpdateProject(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -1130,11 +1111,10 @@ public function testMethodUpdateProject(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1150,7 +1130,6 @@ public function testMethodUpdateProject(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodDeleteProject(): void { $data = ''; @@ -1168,5 +1147,4 @@ public function testMethodDeleteProject(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/PresencesTest.php b/tests/Appwrite/Services/PresencesTest.php index 60a29691..c8732c90 100644 --- a/tests/Appwrite/Services/PresencesTest.php +++ b/tests/Appwrite/Services/PresencesTest.php @@ -1,16 +1,18 @@ 5, - "presences" => array( - array( + "presences" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "userId" => "674af8f3e12a5f9ac0be", "source" => "HTTP" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -45,17 +47,16 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\PresenceList::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "userId" => "674af8f3e12a5f9ac0be", "source" => "HTTP" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -70,17 +71,16 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Presence::class, $response); } - public function testMethodUpsert(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "userId" => "674af8f3e12a5f9ac0be", "source" => "HTTP" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -97,17 +97,16 @@ public function testMethodUpsert(): void $this->assertInstanceOf(\Appwrite\Models\Presence::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "userId" => "674af8f3e12a5f9ac0be", "source" => "HTTP" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -123,7 +122,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Presence::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -141,5 +139,4 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index deb9bf61..362e48c1 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -1,27 +1,25 @@ "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -47,9 +45,9 @@ public function testMethodGet(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -62,29 +60,29 @@ public function testMethodGet(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -94,11 +92,10 @@ public function testMethodGet(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -111,7 +108,6 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -127,18 +123,17 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateAuthMethod(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -146,9 +141,9 @@ public function testMethodUpdateAuthMethod(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -161,29 +156,29 @@ public function testMethodUpdateAuthMethod(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -193,11 +188,10 @@ public function testMethodUpdateAuthMethod(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -213,25 +207,24 @@ public function testMethodUpdateAuthMethod(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodListKeys(): void { - $data = array( + $data = [ "total" => 5, - "keys" => array( - array( + "keys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ) - ); + "sdks" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -244,20 +237,19 @@ public function testMethodListKeys(): void $this->assertInstanceOf(\Appwrite\Models\KeyList::class, $response); } - public function testMethodCreateEphemeralKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -267,26 +259,25 @@ public function testMethodCreateEphemeralKey(): void ->andReturn(''); $response = $this->project->createEphemeralKey( - array(ProjectKeyScopes::PROJECTREAD()), + [ProjectKeyScopes::PROJECTREAD()], 1 ); $this->assertInstanceOf(\Appwrite\Models\EphemeralKey::class, $response); } - public function testMethodGetKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -301,20 +292,19 @@ public function testMethodGetKey(): void $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodUpdateKey(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My API Key", "expire" => "2020-10-15T06:38:00.000+00:00", - "scopes" => array(), + "scopes" => [], "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ); + "sdks" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -326,12 +316,11 @@ public function testMethodUpdateKey(): void $response = $this->project->updateKey( "", "", - array(ProjectKeyScopes::PROJECTREAD()) + [ProjectKeyScopes::PROJECTREAD()] ); $this->assertInstanceOf(\Appwrite\Models\Key::class, $response); } - public function testMethodDeleteKey(): void { $data = ''; @@ -349,18 +338,17 @@ public function testMethodDeleteKey(): void $this->assertSame($data, $response); } - public function testMethodUpdateLabels(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -368,9 +356,9 @@ public function testMethodUpdateLabels(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -383,29 +371,29 @@ public function testMethodUpdateLabels(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -415,11 +403,10 @@ public function testMethodUpdateLabels(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -429,25 +416,24 @@ public function testMethodUpdateLabels(): void ->andReturn(''); $response = $this->project->updateLabels( - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodListMockPhones(): void { - $data = array( + $data = [ "total" => 5, - "mockNumbers" => array( - array( + "mockNumbers" => [ + [ "number" => "+1612842323", "otp" => "123456", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -460,15 +446,14 @@ public function testMethodListMockPhones(): void $this->assertInstanceOf(\Appwrite\Models\MockNumberList::class, $response); } - public function testMethodCreateMockPhone(): void { - $data = array( + $data = [ "number" => "+1612842323", "otp" => "123456", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -484,15 +469,14 @@ public function testMethodCreateMockPhone(): void $this->assertInstanceOf(\Appwrite\Models\MockNumber::class, $response); } - public function testMethodGetMockPhone(): void { - $data = array( + $data = [ "number" => "+1612842323", "otp" => "123456", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -507,15 +491,14 @@ public function testMethodGetMockPhone(): void $this->assertInstanceOf(\Appwrite\Models\MockNumber::class, $response); } - public function testMethodUpdateMockPhone(): void { - $data = array( + $data = [ "number" => "+1612842323", "otp" => "123456", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -531,7 +514,6 @@ public function testMethodUpdateMockPhone(): void $this->assertInstanceOf(\Appwrite\Models\MockNumber::class, $response); } - public function testMethodDeleteMockPhone(): void { $data = ''; @@ -549,13 +531,12 @@ public function testMethodDeleteMockPhone(): void $this->assertSame($data, $response); } - public function testMethodListOAuth2Providers(): void { - $data = array( + $data = [ "total" => 5, - "providers" => array() - ); + "providers" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -568,18 +549,17 @@ public function testMethodListOAuth2Providers(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2ProviderList::class, $response); } - public function testMethodUpdateOAuth2Server(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -587,9 +567,9 @@ public function testMethodUpdateOAuth2Server(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -602,29 +582,29 @@ public function testMethodUpdateOAuth2Server(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -634,11 +614,10 @@ public function testMethodUpdateOAuth2Server(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -654,15 +633,14 @@ public function testMethodUpdateOAuth2Server(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateOAuth2Amazon(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "amzn1.application-oa2-client.87400c00000000000000000000063d5b2", "clientSecret" => "79ffe4000000000000000000000000000000000000000000000000000002de55" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -675,17 +653,16 @@ public function testMethodUpdateOAuth2Amazon(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Amazon::class, $response); } - public function testMethodUpdateOAuth2Apple(): void { - $data = array( + $data = [ "\$id" => "apple", "enabled" => true, "serviceId" => "ip.appwrite.app.web", "keyId" => "P4000000N8", "teamId" => "D4000000R6", "p8File" => "-----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -698,15 +675,14 @@ public function testMethodUpdateOAuth2Apple(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Apple::class, $response); } - public function testMethodUpdateOAuth2Appwrite(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "6a42000000000000b5a0", "clientSecret" => "b86afd000000000000000000000000000000000000000000000000000ced5f93" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -719,16 +695,15 @@ public function testMethodUpdateOAuth2Appwrite(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Appwrite::class, $response); } - public function testMethodUpdateOAuth2Auth0(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "OaOkIA000000000000000000005KLSYq", "clientSecret" => "zXz0000-00000000000000000000000000000-00000000000000000000PJafnF", "endpoint" => "example.us.auth0.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -741,16 +716,15 @@ public function testMethodUpdateOAuth2Auth0(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Auth0::class, $response); } - public function testMethodUpdateOAuth2Authentik(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "dTKOPa0000000000000000000000000000e7G8hv", "clientSecret" => "ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK", "endpoint" => "example.authentik.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -763,15 +737,14 @@ public function testMethodUpdateOAuth2Authentik(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Authentik::class, $response); } - public function testMethodUpdateOAuth2Autodesk(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "5zw90v00000000000000000000kVYXN7", "clientSecret" => "7I000000000000MW" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -784,15 +757,14 @@ public function testMethodUpdateOAuth2Autodesk(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Autodesk::class, $response); } - public function testMethodUpdateOAuth2Bitbucket(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "key" => "Knt70000000000ByRc", "secret" => "NMfLZJ00000000000000000000TLQdDx" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -805,15 +777,14 @@ public function testMethodUpdateOAuth2Bitbucket(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Bitbucket::class, $response); } - public function testMethodUpdateOAuth2Bitly(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "d95151000000000000000000000000000067af9b", "clientSecret" => "a13e250000000000000000000000000000d73095" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -826,15 +797,14 @@ public function testMethodUpdateOAuth2Bitly(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Bitly::class, $response); } - public function testMethodUpdateOAuth2Box(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "deglcs00000000000000000000x2og6y", "clientSecret" => "OKM1f100000000000000000000eshEif" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -847,15 +817,14 @@ public function testMethodUpdateOAuth2Box(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Box::class, $response); } - public function testMethodUpdateOAuth2Dailymotion(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "apiKey" => "07a9000000000000067f", "apiSecret" => "a399a90000000000000000000000000000d90639" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -868,15 +837,14 @@ public function testMethodUpdateOAuth2Dailymotion(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Dailymotion::class, $response); } - public function testMethodUpdateOAuth2Discord(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "950722000000343754", "clientSecret" => "YmPXnM000000000000000000002zFg5D" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -889,15 +857,14 @@ public function testMethodUpdateOAuth2Discord(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Discord::class, $response); } - public function testMethodUpdateOAuth2Disqus(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "publicKey" => "cgegH70000000000000000000000000000000000000000000000000000Hr1nYX", "secretKey" => "W7Bykj00000000000000000000000000000000000000000000000000003o43w9" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -910,15 +877,14 @@ public function testMethodUpdateOAuth2Disqus(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Disqus::class, $response); } - public function testMethodUpdateOAuth2Dropbox(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "appKey" => "jl000000000009t", "appSecret" => "g200000000000vw" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -931,15 +897,14 @@ public function testMethodUpdateOAuth2Dropbox(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Dropbox::class, $response); } - public function testMethodUpdateOAuth2Etsy(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "keyString" => "nsgzxh0000000000008j85a2", "sharedSecret" => "tp000000ru" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -952,15 +917,14 @@ public function testMethodUpdateOAuth2Etsy(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Etsy::class, $response); } - public function testMethodUpdateOAuth2Facebook(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "appId" => "260600000007694", "appSecret" => "2d0b2800000000000000000000d38af4" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -973,15 +937,14 @@ public function testMethodUpdateOAuth2Facebook(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Facebook::class, $response); } - public function testMethodUpdateOAuth2Figma(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "byay5H0000000000VtiI40", "clientSecret" => "yEpOYn0000000000000000004iIsU5" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -994,16 +957,15 @@ public function testMethodUpdateOAuth2Figma(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Figma::class, $response); } - public function testMethodUpdateOAuth2FusionAuth(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "b2222c00-0000-0000-0000-000000862097", "clientSecret" => "Jx4s0C0000000000000000000000000000000wGqLsc", "endpoint" => "example.fusionauth.io" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1016,15 +978,14 @@ public function testMethodUpdateOAuth2FusionAuth(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2FusionAuth::class, $response); } - public function testMethodUpdateOAuth2GitHub(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "e4d87900000000540733", "clientSecret" => "5e07c00000000000000000000000000000198bcc" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1037,16 +998,15 @@ public function testMethodUpdateOAuth2GitHub(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Github::class, $response); } - public function testMethodUpdateOAuth2Gitlab(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "applicationId" => "d41ffe0000000000000000000000000000000000000000000000000000d5e252", "secret" => "gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38", "endpoint" => "https://gitlab.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1059,16 +1019,15 @@ public function testMethodUpdateOAuth2Gitlab(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Gitlab::class, $response); } - public function testMethodUpdateOAuth2Google(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", "clientSecret" => "GOCSPX-2k8gsR0000000000000000VNahJj", - "prompt" => array() - ); + "prompt" => ["none"] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1081,17 +1040,36 @@ public function testMethodUpdateOAuth2Google(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Google::class, $response); } + public function testMethodUpdateOAuth2HuggingFace(): void + { + $data = [ + "\$id" => "github", + "enabled" => true, + "clientId" => "2ab9cff9-d711-40ad-a91e-b08a49c42d24", + "clientSecret" => "oauth_app_secret_wcLhRtl000000000000000000000xbNdLt" + ]; + + $this->client + ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) + ->andReturn($data); + $this->client + ->allows()->getConfig(Mockery::any()) + ->andReturn(''); + + $response = $this->project->updateOAuth2HuggingFace(); + $this->assertInstanceOf(\Appwrite\Models\OAuth2HuggingFace::class, $response); + } public function testMethodUpdateOAuth2Keycloak(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "appwrite-o0000000st-app", "clientSecret" => "jdjrJd00000000000000000000HUsaZO", "endpoint" => "keycloak.example.com", "realmName" => "appwrite-realm" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1104,15 +1082,14 @@ public function testMethodUpdateOAuth2Keycloak(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Keycloak::class, $response); } - public function testMethodUpdateOAuth2Kick(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "01KQ7C00000000000001MFHS32", "clientSecret" => "34ac5600000000000000000000000000000000000000000000000000e830c8b" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1125,15 +1102,14 @@ public function testMethodUpdateOAuth2Kick(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Kick::class, $response); } - public function testMethodUpdateOAuth2Linkedin(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "770000000000dv", "primaryClientSecret" => "WPL_AP1.2Bf0000000000000./HtlYw==" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1146,16 +1122,15 @@ public function testMethodUpdateOAuth2Linkedin(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Linkedin::class, $response); } - public function testMethodUpdateOAuth2Microsoft(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "applicationId" => "00001111-aaaa-2222-bbbb-3333cccc4444", "applicationSecret" => "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", "tenant" => "common" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1168,15 +1143,14 @@ public function testMethodUpdateOAuth2Microsoft(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Microsoft::class, $response); } - public function testMethodUpdateOAuth2Notion(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "oauthClientId" => "341d8700-0000-0000-0000-000000446ee3", "oauthClientSecret" => "secret_dLUr4b000000000000000000000000000000lFHAa9" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1189,10 +1163,9 @@ public function testMethodUpdateOAuth2Notion(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Notion::class, $response); } - public function testMethodUpdateOAuth2Oidc(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "qibI2x0000000000000000000000000006L2YFoG", @@ -1201,8 +1174,8 @@ public function testMethodUpdateOAuth2Oidc(): void "authorizationURL" => "https://myoauth.com/oauth2/authorize", "tokenURL" => "https://myoauth.com/oauth2/token", "userInfoURL" => "https://myoauth.com/oauth2/userinfo", - "prompt" => array() - ); + "prompt" => ["none"] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1215,17 +1188,16 @@ public function testMethodUpdateOAuth2Oidc(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Oidc::class, $response); } - public function testMethodUpdateOAuth2Okta(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "0oa00000000000000698", "clientSecret" => "Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV", "domain" => "trial-6400025.okta.com", "authorizationServerId" => "aus000000000000000h7z" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1238,15 +1210,14 @@ public function testMethodUpdateOAuth2Okta(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Okta::class, $response); } - public function testMethodUpdateOAuth2Paypal(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", "secretKey" => "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1259,15 +1230,14 @@ public function testMethodUpdateOAuth2Paypal(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Paypal::class, $response); } - public function testMethodUpdateOAuth2PaypalSandbox(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB", "secretKey" => "EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1280,15 +1250,14 @@ public function testMethodUpdateOAuth2PaypalSandbox(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Paypal::class, $response); } - public function testMethodUpdateOAuth2Podio(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "appwrite-oauth-test-app", "clientSecret" => "Rn247T0000000000000000000000000000000000000000000000000000W2zWTN" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1301,15 +1270,14 @@ public function testMethodUpdateOAuth2Podio(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Podio::class, $response); } - public function testMethodUpdateOAuth2Salesforce(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "customerKey" => "3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq", "customerSecret" => "3w000000000000e2" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1322,15 +1290,14 @@ public function testMethodUpdateOAuth2Salesforce(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Salesforce::class, $response); } - public function testMethodUpdateOAuth2Slack(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "23000000089.15000000000023", "clientSecret" => "81656000000000000000000000f3d2fd" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1343,15 +1310,14 @@ public function testMethodUpdateOAuth2Slack(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Slack::class, $response); } - public function testMethodUpdateOAuth2Spotify(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "6ec271000000000000000000009beace", "clientSecret" => "db068a000000000000000000008b5b9f" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1364,15 +1330,14 @@ public function testMethodUpdateOAuth2Spotify(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Spotify::class, $response); } - public function testMethodUpdateOAuth2Stripe(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "ca_UKibXX0000000000000000000006byvR", "apiSecretKey" => "sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1385,15 +1350,14 @@ public function testMethodUpdateOAuth2Stripe(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Stripe::class, $response); } - public function testMethodUpdateOAuth2Tradeshift(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "oauth2ClientId" => "appwrite-test-org.appwrite-test-app", "oauth2ClientSecret" => "7cb52700-0000-0000-0000-000000ca5b83" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1406,15 +1370,14 @@ public function testMethodUpdateOAuth2Tradeshift(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Tradeshift::class, $response); } - public function testMethodUpdateOAuth2TradeshiftSandbox(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "oauth2ClientId" => "appwrite-test-org.appwrite-test-app", "oauth2ClientSecret" => "7cb52700-0000-0000-0000-000000ca5b83" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1427,15 +1390,14 @@ public function testMethodUpdateOAuth2TradeshiftSandbox(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Tradeshift::class, $response); } - public function testMethodUpdateOAuth2Twitch(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "vvi0in000000000000000000ikmt9p", "clientSecret" => "pmapue000000000000000000zylw3v" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1448,15 +1410,14 @@ public function testMethodUpdateOAuth2Twitch(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Twitch::class, $response); } - public function testMethodUpdateOAuth2WordPress(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "130005", "clientSecret" => "PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1469,15 +1430,14 @@ public function testMethodUpdateOAuth2WordPress(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2WordPress::class, $response); } - public function testMethodUpdateOAuth2X(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "customerKey" => "slzZV0000000000000NFLaWT", "secretKey" => "tkEPkp00000000000000000000000000000000000000FTxbI9" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1490,15 +1450,14 @@ public function testMethodUpdateOAuth2X(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2X::class, $response); } - public function testMethodUpdateOAuth2Yahoo(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm", "clientSecret" => "cf978f0000000000000000000000000000c5e2e9" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1511,15 +1470,14 @@ public function testMethodUpdateOAuth2Yahoo(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Yahoo::class, $response); } - public function testMethodUpdateOAuth2Yandex(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "6a8a6a0000000000000000000091483c", "clientSecret" => "bbf98500000000000000000000c75a63" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1532,15 +1490,14 @@ public function testMethodUpdateOAuth2Yandex(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Yandex::class, $response); } - public function testMethodUpdateOAuth2Zoho(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "1000.83C178000000000000000000RPNX0B", "clientSecret" => "fb5cac000000000000000000000000000000a68f6e" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1553,15 +1510,14 @@ public function testMethodUpdateOAuth2Zoho(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Zoho::class, $response); } - public function testMethodUpdateOAuth2Zoom(): void { - $data = array( + $data = [ "\$id" => "github", "enabled" => true, "clientId" => "QMAC00000000000000w0AQ", "clientSecret" => "GAWsG4000000000000000000007U01ON" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1574,20 +1530,19 @@ public function testMethodUpdateOAuth2Zoom(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Zoom::class, $response); } - public function testMethodGetOAuth2Provider(): void { $data = array_replace( - array( + [ "\$id" => "github", "enabled" => true, "applicationId" => "00001111-aaaa-2222-bbbb-3333cccc4444", "applicationSecret" => "A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u", "tenant" => "common" - ), - array( + ], + [ "\$id" => "microsoft" - ) + ] ); $this->client @@ -1603,13 +1558,12 @@ public function testMethodGetOAuth2Provider(): void $this->assertInstanceOf(\Appwrite\Models\OAuth2Microsoft::class, $response); } - public function testMethodListPlatforms(): void { - $data = array( + $data = [ "total" => 5, - "platforms" => array() - ); + "platforms" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1622,17 +1576,16 @@ public function testMethodListPlatforms(): void $this->assertInstanceOf(\Appwrite\Models\PlatformList::class, $response); } - public function testMethodCreateAndroidPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "applicationId" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1649,17 +1602,16 @@ public function testMethodCreateAndroidPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformAndroid::class, $response); } - public function testMethodUpdateAndroidPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "applicationId" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1676,17 +1628,16 @@ public function testMethodUpdateAndroidPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformAndroid::class, $response); } - public function testMethodCreateApplePlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "bundleIdentifier" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1703,17 +1654,16 @@ public function testMethodCreateApplePlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformApple::class, $response); } - public function testMethodUpdateApplePlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "bundleIdentifier" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1730,17 +1680,16 @@ public function testMethodUpdateApplePlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformApple::class, $response); } - public function testMethodCreateLinuxPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageName" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1757,17 +1706,16 @@ public function testMethodCreateLinuxPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformLinux::class, $response); } - public function testMethodUpdateLinuxPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageName" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1784,17 +1732,16 @@ public function testMethodUpdateLinuxPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformLinux::class, $response); } - public function testMethodCreateWebPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "hostname" => "app.example.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1811,17 +1758,16 @@ public function testMethodCreateWebPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformWeb::class, $response); } - public function testMethodUpdateWebPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "hostname" => "app.example.com" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1838,17 +1784,16 @@ public function testMethodUpdateWebPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformWeb::class, $response); } - public function testMethodCreateWindowsPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageIdentifierName" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1865,17 +1810,16 @@ public function testMethodCreateWindowsPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformWindows::class, $response); } - public function testMethodUpdateWindowsPlatform(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageIdentifierName" => "com.company.appname" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1892,21 +1836,20 @@ public function testMethodUpdateWindowsPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformWindows::class, $response); } - public function testMethodGetPlatform(): void { $data = array_replace( - array( + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Web App", "type" => "windows", "packageName" => "com.company.appname" - ), - array( + ], + [ "type" => "linux" - ) + ] ); $this->client @@ -1922,7 +1865,6 @@ public function testMethodGetPlatform(): void $this->assertInstanceOf(\Appwrite\Models\PlatformLinux::class, $response); } - public function testMethodDeletePlatform(): void { $data = ''; @@ -1940,13 +1882,12 @@ public function testMethodDeletePlatform(): void $this->assertSame($data, $response); } - public function testMethodListPolicies(): void { - $data = array( + $data = [ "total" => 10, - "policies" => array() - ); + "policies" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1959,18 +1900,17 @@ public function testMethodListPolicies(): void $this->assertInstanceOf(\Appwrite\Models\PolicyList::class, $response); } - public function testMethodUpdateDenyAliasedEmailPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1978,9 +1918,9 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -1993,29 +1933,29 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2025,11 +1965,10 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2044,18 +1983,17 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateDenyCorporateEmailPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2063,9 +2001,9 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2078,29 +2016,29 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2110,11 +2048,10 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2129,18 +2066,17 @@ public function testMethodUpdateDenyCorporateEmailPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateDenyDisposableEmailPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2148,9 +2084,9 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2163,29 +2099,29 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2195,11 +2131,10 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2214,18 +2149,17 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateDenyFreeEmailPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2233,9 +2167,9 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2248,29 +2182,29 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2280,11 +2214,10 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2299,18 +2232,17 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateMembershipPrivacyPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2318,9 +2250,9 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2333,29 +2265,29 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2365,11 +2297,10 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2382,18 +2313,17 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateMFAFactorsPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2401,9 +2331,9 @@ public function testMethodUpdateMFAFactorsPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2416,29 +2346,29 @@ public function testMethodUpdateMFAFactorsPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2448,11 +2378,10 @@ public function testMethodUpdateMFAFactorsPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2465,18 +2394,17 @@ public function testMethodUpdateMFAFactorsPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdatePasswordDictionaryPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2484,9 +2412,9 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2499,29 +2427,29 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2531,11 +2459,10 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2550,18 +2477,17 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdatePasswordHistoryPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2569,9 +2495,9 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2584,29 +2510,29 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2616,11 +2542,10 @@ public function testMethodUpdatePasswordHistoryPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2635,18 +2560,17 @@ public function testMethodUpdatePasswordHistoryPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdatePasswordPersonalDataPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2654,9 +2578,9 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2669,29 +2593,29 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2701,11 +2625,10 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2720,17 +2643,16 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdatePasswordStrengthPolicy(): void { - $data = array( + $data = [ "\$id" => "password-dictionary", "min" => 12, "uppercase" => true, "lowercase" => true, "number" => true, "symbols" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2743,18 +2665,17 @@ public function testMethodUpdatePasswordStrengthPolicy(): void $this->assertInstanceOf(\Appwrite\Models\PolicyPasswordStrength::class, $response); } - public function testMethodUpdateSessionAlertPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2762,9 +2683,9 @@ public function testMethodUpdateSessionAlertPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2777,29 +2698,29 @@ public function testMethodUpdateSessionAlertPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2809,11 +2730,10 @@ public function testMethodUpdateSessionAlertPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2828,18 +2748,17 @@ public function testMethodUpdateSessionAlertPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateSessionDurationPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2847,9 +2766,9 @@ public function testMethodUpdateSessionDurationPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2862,29 +2781,29 @@ public function testMethodUpdateSessionDurationPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2894,11 +2813,10 @@ public function testMethodUpdateSessionDurationPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2913,18 +2831,17 @@ public function testMethodUpdateSessionDurationPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateSessionInvalidationPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2932,9 +2849,9 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -2947,29 +2864,29 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -2979,11 +2896,10 @@ public function testMethodUpdateSessionInvalidationPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2998,18 +2914,17 @@ public function testMethodUpdateSessionInvalidationPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateSessionLimitPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3017,9 +2932,9 @@ public function testMethodUpdateSessionLimitPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3032,29 +2947,29 @@ public function testMethodUpdateSessionLimitPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3064,11 +2979,10 @@ public function testMethodUpdateSessionLimitPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3083,18 +2997,17 @@ public function testMethodUpdateSessionLimitPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateUserLimitPolicy(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3102,9 +3015,9 @@ public function testMethodUpdateUserLimitPolicy(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3117,29 +3030,29 @@ public function testMethodUpdateUserLimitPolicy(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3149,11 +3062,10 @@ public function testMethodUpdateUserLimitPolicy(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3168,17 +3080,16 @@ public function testMethodUpdateUserLimitPolicy(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodGetPolicy(): void { $data = array_replace( - array( + [ "\$id" => "password-dictionary", "enabled" => true - ), - array( + ], + [ "\$id" => "deny-corporate-email" - ) + ] ); $this->client @@ -3194,18 +3105,17 @@ public function testMethodGetPolicy(): void $this->assertInstanceOf(\Appwrite\Models\PolicyDenyCorporateEmail::class, $response); } - public function testMethodUpdateProtocol(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3213,9 +3123,9 @@ public function testMethodUpdateProtocol(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3228,29 +3138,29 @@ public function testMethodUpdateProtocol(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3260,11 +3170,10 @@ public function testMethodUpdateProtocol(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3280,18 +3189,17 @@ public function testMethodUpdateProtocol(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateService(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3299,9 +3207,9 @@ public function testMethodUpdateService(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3314,29 +3222,29 @@ public function testMethodUpdateService(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3346,11 +3254,10 @@ public function testMethodUpdateService(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3366,18 +3273,17 @@ public function testMethodUpdateService(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodUpdateSMTP(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "New Project", "teamId" => "1592981250", "region" => "fra", - "devKeys" => array( - array( + "devKeys" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3385,9 +3291,9 @@ public function testMethodUpdateSMTP(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "919c2d18fb5d4...a2ae413da83346ad2", "accessedAt" => "2020-10-15T06:38:00.000+00:00", - "sdks" => array() - ) - ), + "sdks" => [] + ] + ], "smtpEnabled" => true, "smtpSenderName" => "John Appwrite", "smtpSenderEmail" => "john@appwrite.io", @@ -3400,29 +3306,29 @@ public function testMethodUpdateSMTP(): void "smtpSecure" => "tls", "pingCount" => 1, "pingedAt" => "2020-10-15T06:38:00.000+00:00", - "labels" => array(), + "labels" => [], "status" => "active", - "onboarding" => array(), - "authMethods" => array( - array( + "onboarding" => [], + "authMethods" => [ + [ "\$id" => "email-password", "enabled" => true - ) - ), - "services" => array( - array( + ] + ], + "services" => [ + [ "\$id" => "account", "enabled" => true - ) - ), - "protocols" => array( - array( + ] + ], + "protocols" => [ + [ "\$id" => "rest", "enabled" => true - ) - ), - "blocks" => array( - array( + ] + ], + "blocks" => [ + [ "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceType" => "project", "resourceId" => "5e5ea5c16897e", @@ -3432,11 +3338,10 @@ public function testMethodUpdateSMTP(): void "organizationName" => "Acme Inc.", "organizationId" => "5e5ea5c16897e", "billingPlan" => "pro" - ) - ), - "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "wafEnabled" => true - ); + ] + ], + "consoleAccessedAt" => "2020-10-15T06:38:00.000+00:00" + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3449,7 +3354,6 @@ public function testMethodUpdateSMTP(): void $this->assertInstanceOf(\Appwrite\Models\Project::class, $response); } - public function testMethodCreateSMTPTest(): void { $data = ''; @@ -3462,18 +3366,17 @@ public function testMethodCreateSMTPTest(): void ->andReturn(''); $response = $this->project->createSMTPTest( - array() + [] ); $this->assertSame($data, $response); } - public function testMethodListEmailTemplates(): void { - $data = array( + $data = [ "total" => 5, - "templates" => array( - array( + "templates" => [ + [ "templateId" => "verification", "locale" => "en_us", "message" => "Click on the link to verify your account.", @@ -3482,9 +3385,9 @@ public function testMethodListEmailTemplates(): void "replyToEmail" => "emails@appwrite.io", "replyToName" => "Support Team", "subject" => "Please verify your email address" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3497,10 +3400,9 @@ public function testMethodListEmailTemplates(): void $this->assertInstanceOf(\Appwrite\Models\EmailTemplateList::class, $response); } - public function testMethodUpdateEmailTemplate(): void { - $data = array( + $data = [ "templateId" => "verification", "locale" => "en_us", "message" => "Click on the link to verify your account.", @@ -3509,7 +3411,7 @@ public function testMethodUpdateEmailTemplate(): void "replyToEmail" => "emails@appwrite.io", "replyToName" => "Support Team", "subject" => "Please verify your email address" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3524,10 +3426,9 @@ public function testMethodUpdateEmailTemplate(): void $this->assertInstanceOf(\Appwrite\Models\EmailTemplate::class, $response); } - public function testMethodGetEmailTemplate(): void { - $data = array( + $data = [ "templateId" => "verification", "locale" => "en_us", "message" => "Click on the link to verify your account.", @@ -3536,7 +3437,7 @@ public function testMethodGetEmailTemplate(): void "replyToEmail" => "emails@appwrite.io", "replyToName" => "Support Team", "subject" => "Please verify your email address" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3551,13 +3452,12 @@ public function testMethodGetEmailTemplate(): void $this->assertInstanceOf(\Appwrite\Models\EmailTemplate::class, $response); } - public function testMethodListVariables(): void { - $data = array( + $data = [ "total" => 5, - "variables" => array( - array( + "variables" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3566,9 +3466,9 @@ public function testMethodListVariables(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3581,10 +3481,9 @@ public function testMethodListVariables(): void $this->assertInstanceOf(\Appwrite\Models\VariableList::class, $response); } - public function testMethodCreateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3593,7 +3492,7 @@ public function testMethodCreateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3604,16 +3503,15 @@ public function testMethodCreateVariable(): void $response = $this->project->createVariable( "", - "", + "", "" ); $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodGetVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3622,7 +3520,7 @@ public function testMethodGetVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3637,10 +3535,9 @@ public function testMethodGetVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodUpdateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -3649,7 +3546,7 @@ public function testMethodUpdateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -3664,7 +3561,6 @@ public function testMethodUpdateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodDeleteVariable(): void { $data = ''; @@ -3682,5 +3578,4 @@ public function testMethodDeleteVariable(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/ProxyTest.php b/tests/Appwrite/Services/ProxyTest.php index d4b3eab1..89affa1f 100644 --- a/tests/Appwrite/Services/ProxyTest.php +++ b/tests/Appwrite/Services/ProxyTest.php @@ -1,10 +1,12 @@ "appwrite.company.com", "type" => "tag", "reference" => "products", "status" => "success" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -44,13 +46,12 @@ public function testMethodCreateInvalidation(): void $this->assertInstanceOf(\Appwrite\Models\ProxyInvalidation::class, $response); } - public function testMethodListRules(): void { - $data = array( + $data = [ "total" => 5, - "rules" => array( - array( + "rules" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -65,9 +66,9 @@ public function testMethodListRules(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -80,10 +81,9 @@ public function testMethodListRules(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRuleList::class, $response); } - public function testMethodCreateAPIRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -98,7 +98,7 @@ public function testMethodCreateAPIRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -113,10 +113,9 @@ public function testMethodCreateAPIRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodCreateFunctionRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -131,7 +130,7 @@ public function testMethodCreateFunctionRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -147,10 +146,9 @@ public function testMethodCreateFunctionRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodCreateRedirectRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -165,7 +163,7 @@ public function testMethodCreateRedirectRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -184,10 +182,9 @@ public function testMethodCreateRedirectRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodCreateSiteRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -202,7 +199,7 @@ public function testMethodCreateSiteRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -218,10 +215,9 @@ public function testMethodCreateSiteRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodGetRule(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -236,7 +232,7 @@ public function testMethodGetRule(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -251,7 +247,6 @@ public function testMethodGetRule(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - public function testMethodDeleteRule(): void { $data = ''; @@ -269,10 +264,9 @@ public function testMethodDeleteRule(): void $this->assertSame($data, $response); } - public function testMethodUpdateRuleStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -287,7 +281,7 @@ public function testMethodUpdateRuleStatus(): void "status" => "unverified", "logs" => "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", "renewAt" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -302,5 +296,4 @@ public function testMethodUpdateRuleStatus(): void $this->assertInstanceOf(\Appwrite\Models\ProxyRule::class, $response); } - } diff --git a/tests/Appwrite/Services/SitesTest.php b/tests/Appwrite/Services/SitesTest.php index e3297142..b2c9299f 100644 --- a/tests/Appwrite/Services/SitesTest.php +++ b/tests/Appwrite/Services/SitesTest.php @@ -1,22 +1,23 @@ 5, - "sites" => array( - array( + "sites" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -46,8 +47,9 @@ public function testMethodList(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -56,8 +58,8 @@ public function testMethodList(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -68,16 +70,16 @@ public function testMethodList(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -90,10 +92,9 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\SiteList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -110,8 +111,9 @@ public function testMethodCreate(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -120,8 +122,8 @@ public function testMethodCreate(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -132,14 +134,14 @@ public function testMethodCreate(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -157,29 +159,28 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); } - public function testMethodListFrameworks(): void { - $data = array( + $data = [ "total" => 5, - "frameworks" => array( - array( + "frameworks" => [ + [ "key" => "sveltekit", "name" => "SvelteKit", "buildRuntime" => "node-22", - "runtimes" => array(), - "adapters" => array( - array( + "runtimes" => [], + "adapters" => [ + [ "key" => "static", "installCommand" => "npm install", "buildCommand" => "npm run build", "outputDirectory" => "./dist", "fallbackFile" => "index.html" - ) - ) - ) - ) - ); + ] + ] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -192,20 +193,19 @@ public function testMethodListFrameworks(): void $this->assertInstanceOf(\Appwrite\Models\FrameworkList::class, $response); } - public function testMethodListSpecifications(): void { - $data = array( + $data = [ "total" => 5, - "specifications" => array( - array( + "specifications" => [ + [ "memory" => 512, "cpus" => 1, "enabled" => true, "slug" => "s-1vcpu-512mb" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -218,10 +218,9 @@ public function testMethodListSpecifications(): void $this->assertInstanceOf(\Appwrite\Models\SpecificationList::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -238,8 +237,9 @@ public function testMethodGet(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -248,8 +248,8 @@ public function testMethodGet(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -260,14 +260,14 @@ public function testMethodGet(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -282,10 +282,9 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -302,8 +301,9 @@ public function testMethodUpdate(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -312,8 +312,8 @@ public function testMethodUpdate(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -324,14 +324,14 @@ public function testMethodUpdate(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -348,7 +348,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -366,10 +365,9 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateSiteDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -386,8 +384,9 @@ public function testMethodUpdateSiteDeployment(): void "latestDeploymentId" => "5e5ea5c16897e", "latestDeploymentCreatedAt" => "2020-10-15T06:38:00.000+00:00", "latestDeploymentStatus" => "ready", - "vars" => array( - array( + "scopes" => [], + "vars" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -396,8 +395,8 @@ public function testMethodUpdateSiteDeployment(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ), + ] + ], "timeout" => 300, "installCommand" => "npm install", "buildCommand" => "npm run build", @@ -408,14 +407,14 @@ public function testMethodUpdateSiteDeployment(): void "providerBranch" => "main", "providerRootDirectory" => "sites/helloWorld", "providerSilentMode" => true, - "providerBranches" => array(), - "providerPaths" => array(), + "providerBranches" => [], + "providerPaths" => [], "buildSpecification" => "s-1vcpu-512mb", "runtimeSpecification" => "s-1vcpu-512mb", "buildRuntime" => "node-22", "adapter" => "static", "fallbackFile" => "index.html" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -431,13 +430,12 @@ public function testMethodUpdateSiteDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Site::class, $response); } - public function testMethodListDeployments(): void { - $data = array( + $data = [ "total" => 5, - "deployments" => array( - array( + "deployments" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -465,9 +463,9 @@ public function testMethodListDeployments(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -482,10 +480,9 @@ public function testMethodListDeployments(): void $this->assertInstanceOf(\Appwrite\Models\DeploymentList::class, $response); } - public function testMethodCreateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -513,7 +510,7 @@ public function testMethodCreateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -529,10 +526,9 @@ public function testMethodCreateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateDuplicateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -560,7 +556,7 @@ public function testMethodCreateDuplicateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -576,10 +572,9 @@ public function testMethodCreateDuplicateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateTemplateDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -607,7 +602,7 @@ public function testMethodCreateTemplateDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -627,10 +622,9 @@ public function testMethodCreateTemplateDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodCreateVcsDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -658,7 +652,7 @@ public function testMethodCreateVcsDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -675,10 +669,9 @@ public function testMethodCreateVcsDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodGetDeployment(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -706,7 +699,7 @@ public function testMethodGetDeployment(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -722,7 +715,6 @@ public function testMethodGetDeployment(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodDeleteDeployment(): void { $data = ''; @@ -741,7 +733,6 @@ public function testMethodDeleteDeployment(): void $this->assertSame($data, $response); } - public function testMethodGetDeploymentDownload(): void { $data = ''; @@ -760,10 +751,9 @@ public function testMethodGetDeploymentDownload(): void $this->assertSame($data, $response); } - public function testMethodUpdateDeploymentStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -791,7 +781,7 @@ public function testMethodUpdateDeploymentStatus(): void "providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", "providerBranch" => "0.7.x", "providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -807,43 +797,43 @@ public function testMethodUpdateDeploymentStatus(): void $this->assertInstanceOf(\Appwrite\Models\Deployment::class, $response); } - public function testMethodListLogs(): void { - $data = array( + $data = [ "total" => 5, - "executions" => array( - array( + "executions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -858,38 +848,38 @@ public function testMethodListLogs(): void $this->assertInstanceOf(\Appwrite\Models\ExecutionList::class, $response); } - public function testMethodGetLog(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), - "functionId" => "5e5ea6g16897e", + "\$permissions" => [], + "resourceId" => "5e5ea6g16897e", + "resourceType" => "functions", "deploymentId" => "5e5ea5c16897e", "trigger" => "http", "status" => "waiting", "requestMethod" => "GET", "requestPath" => "/articles?id=5", - "requestHeaders" => array( - array( + "requestHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "responseStatusCode" => 200, "responseBody" => "[RESPONSEBODY]", - "responseHeaders" => array( - array( + "responseHeaders" => [ + [ "name" => "Content-Type", "value" => "application/json" - ) - ), + ] + ], "logs" => "[LOGS]", "errors" => "[ERRORS]", "duration" => 0.4 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -905,7 +895,6 @@ public function testMethodGetLog(): void $this->assertInstanceOf(\Appwrite\Models\Execution::class, $response); } - public function testMethodDeleteLog(): void { $data = ''; @@ -924,13 +913,12 @@ public function testMethodDeleteLog(): void $this->assertSame($data, $response); } - public function testMethodListVariables(): void { - $data = array( + $data = [ "total" => 5, - "variables" => array( - array( + "variables" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -939,9 +927,9 @@ public function testMethodListVariables(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -956,10 +944,9 @@ public function testMethodListVariables(): void $this->assertInstanceOf(\Appwrite\Models\VariableList::class, $response); } - public function testMethodCreateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -968,7 +955,7 @@ public function testMethodCreateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -980,16 +967,15 @@ public function testMethodCreateVariable(): void $response = $this->sites->createVariable( "", "", - "", + "", "" ); $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodGetVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -998,7 +984,7 @@ public function testMethodGetVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1014,10 +1000,9 @@ public function testMethodGetVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodUpdateVariable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1026,7 +1011,7 @@ public function testMethodUpdateVariable(): void "secret" => true, "resourceType" => "function", "resourceId" => "myAwesomeFunction" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1042,7 +1027,6 @@ public function testMethodUpdateVariable(): void $this->assertInstanceOf(\Appwrite\Models\Variable::class, $response); } - public function testMethodDeleteVariable(): void { $data = ''; @@ -1061,5 +1045,4 @@ public function testMethodDeleteVariable(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/StorageTest.php b/tests/Appwrite/Services/StorageTest.php index 3fd5a6f6..fd79ef3c 100644 --- a/tests/Appwrite/Services/StorageTest.php +++ b/tests/Appwrite/Services/StorageTest.php @@ -1,19 +1,19 @@ 5, - "buckets" => array( - array( + "buckets" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "fileSecurity" => true, "name" => "Documents", "enabled" => true, "maximumFileSize" => 100, - "allowedFileExtensions" => array(), + "allowedFileExtensions" => [], "compression" => "gzip", "encryption" => true, "antivirus" => true, "transformations" => true, "totalSize" => 128 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -56,25 +56,24 @@ public function testMethodListBuckets(): void $this->assertInstanceOf(\Appwrite\Models\BucketList::class, $response); } - public function testMethodCreateBucket(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "fileSecurity" => true, "name" => "Documents", "enabled" => true, "maximumFileSize" => 100, - "allowedFileExtensions" => array(), + "allowedFileExtensions" => [], "compression" => "gzip", "encryption" => true, "antivirus" => true, "transformations" => true, "totalSize" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -90,25 +89,24 @@ public function testMethodCreateBucket(): void $this->assertInstanceOf(\Appwrite\Models\Bucket::class, $response); } - public function testMethodGetBucket(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "fileSecurity" => true, "name" => "Documents", "enabled" => true, "maximumFileSize" => 100, - "allowedFileExtensions" => array(), + "allowedFileExtensions" => [], "compression" => "gzip", "encryption" => true, "antivirus" => true, "transformations" => true, "totalSize" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -123,25 +121,24 @@ public function testMethodGetBucket(): void $this->assertInstanceOf(\Appwrite\Models\Bucket::class, $response); } - public function testMethodUpdateBucket(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "fileSecurity" => true, "name" => "Documents", "enabled" => true, "maximumFileSize" => 100, - "allowedFileExtensions" => array(), + "allowedFileExtensions" => [], "compression" => "gzip", "encryption" => true, "antivirus" => true, "transformations" => true, "totalSize" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -157,7 +154,6 @@ public function testMethodUpdateBucket(): void $this->assertInstanceOf(\Appwrite\Models\Bucket::class, $response); } - public function testMethodDeleteBucket(): void { $data = ''; @@ -175,18 +171,17 @@ public function testMethodDeleteBucket(): void $this->assertSame($data, $response); } - public function testMethodListFiles(): void { - $data = array( + $data = [ "total" => 5, - "files" => array( - array( + "files" => [ + [ "\$id" => "5e5ea5c16897e", "bucketId" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "name" => "Pink.png", "folder" => "photos/2026/", "key" => "photos/2026/Pink.png", @@ -198,9 +193,9 @@ public function testMethodListFiles(): void "chunksUploaded" => 17890, "encryption" => true, "compression" => "gzip" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -215,15 +210,14 @@ public function testMethodListFiles(): void $this->assertInstanceOf(\Appwrite\Models\FileList::class, $response); } - public function testMethodCreateFile(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "bucketId" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "name" => "Pink.png", "folder" => "photos/2026/", "key" => "photos/2026/Pink.png", @@ -235,7 +229,7 @@ public function testMethodCreateFile(): void "chunksUploaded" => 17890, "encryption" => true, "compression" => "gzip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -252,15 +246,14 @@ public function testMethodCreateFile(): void $this->assertInstanceOf(\Appwrite\Models\File::class, $response); } - public function testMethodGetFile(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "bucketId" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "name" => "Pink.png", "folder" => "photos/2026/", "key" => "photos/2026/Pink.png", @@ -272,7 +265,7 @@ public function testMethodGetFile(): void "chunksUploaded" => 17890, "encryption" => true, "compression" => "gzip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -288,15 +281,14 @@ public function testMethodGetFile(): void $this->assertInstanceOf(\Appwrite\Models\File::class, $response); } - public function testMethodUpdateFile(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "bucketId" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "name" => "Pink.png", "folder" => "photos/2026/", "key" => "photos/2026/Pink.png", @@ -308,7 +300,7 @@ public function testMethodUpdateFile(): void "chunksUploaded" => 17890, "encryption" => true, "compression" => "gzip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -324,7 +316,6 @@ public function testMethodUpdateFile(): void $this->assertInstanceOf(\Appwrite\Models\File::class, $response); } - public function testMethodDeleteFile(): void { $data = ''; @@ -343,7 +334,6 @@ public function testMethodDeleteFile(): void $this->assertSame($data, $response); } - public function testMethodGetFileDownload(): void { $data = ''; @@ -362,7 +352,6 @@ public function testMethodGetFileDownload(): void $this->assertSame($data, $response); } - public function testMethodGetFilePreview(): void { $data = ''; @@ -381,7 +370,6 @@ public function testMethodGetFilePreview(): void $this->assertSame($data, $response); } - public function testMethodGetFileView(): void { $data = ''; @@ -400,5 +388,4 @@ public function testMethodGetFileView(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/TablesDBTest.php b/tests/Appwrite/Services/TablesDBTest.php index 31b4e262..6a705d13 100644 --- a/tests/Appwrite/Services/TablesDBTest.php +++ b/tests/Appwrite/Services/TablesDBTest.php @@ -1,20 +1,20 @@ 5, - "databases" => array( - array( + "databases" => [ + [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -49,17 +49,16 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -75,12 +74,11 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodListSpecifications(): void { - $data = array( - "specifications" => array( - array( + $data = [ + "specifications" => [ + [ "slug" => "s-2vcpu-2gb", "name" => "Standard", "price" => 20, @@ -90,16 +88,16 @@ public function testMethodListSpecifications(): void "includedStorage" => 25, "includedBandwidth" => 200, "enabled" => true - ) - ), + ] + ], "total" => 9, - "pricing" => array( + "pricing" => [ "storageOverageRate" => 0.125, "bandwidthOverageRate" => 0.08, "replicaRate" => 1, "pitrRate" => 0.2 - ) - ); + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -112,22 +110,21 @@ public function testMethodListSpecifications(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseSpecificationList::class, $response); } - public function testMethodListTransactions(): void { - $data = array( + $data = [ "total" => 5, - "transactions" => array( - array( + "transactions" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -140,17 +137,16 @@ public function testMethodListTransactions(): void $this->assertInstanceOf(\Appwrite\Models\TransactionList::class, $response); } - public function testMethodCreateTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -163,17 +159,16 @@ public function testMethodCreateTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodGetTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -188,17 +183,16 @@ public function testMethodGetTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodUpdateTransaction(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -213,7 +207,6 @@ public function testMethodUpdateTransaction(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodDeleteTransaction(): void { $data = ''; @@ -231,17 +224,16 @@ public function testMethodDeleteTransaction(): void $this->assertSame($data, $response); } - public function testMethodCreateOperations(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "status" => "pending", "operations" => 5, "expiresAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -256,17 +248,16 @@ public function testMethodCreateOperations(): void $this->assertInstanceOf(\Appwrite\Models\Transaction::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -281,17 +272,16 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "name" => "My Database", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "enabled" => true, "type" => "legacy" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -306,7 +296,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\Database::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -324,10 +313,9 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodCreateFailover(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -358,7 +346,7 @@ public function testMethodCreateFailover(): void "syncMode" => "async", "networkMaxConnections" => 500, "networkIdleTimeoutSeconds" => 900, - "networkIPAllowlist" => array(), + "networkIPAllowlist" => [], "backupEnabled" => true, "pitr" => true, "pitrRetentionDays" => 14, @@ -369,12 +357,12 @@ public function testMethodCreateFailover(): void "maintenanceWindowHourUtc" => 3, "metricsEnabled" => true, "sqlApiEnabled" => true, - "sqlApiAllowedStatements" => array(), + "sqlApiAllowedStatements" => [], "sqlApiMaxRows" => 10000, "sqlApiMaxBytes" => 10485760, "sqlApiTimeoutSeconds" => 30, "error" => "[ERROR]" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -389,13 +377,12 @@ public function testMethodCreateFailover(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabase::class, $response); } - public function testMethodListMigrations(): void { - $data = array( + $data = [ "total" => 5, - "migrations" => array( - array( + "migrations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -406,15 +393,16 @@ public function testMethodListMigrations(): void "attempt" => 0, "lastError" => "[LASTERROR]", "lagDocuments" => 0, + "changelogWatermark" => 0, "verifiedAt" => "2020-10-15T06:38:00.000+00:00", "cutoverAt" => "2020-10-15T06:38:00.000+00:00", "soakUntil" => "2020-10-15T06:38:00.000+00:00", "autoCutover" => true, "cutoverRequested" => true, "paused" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -429,10 +417,9 @@ public function testMethodListMigrations(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseMigrationList::class, $response); } - public function testMethodCreateMigration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -443,13 +430,14 @@ public function testMethodCreateMigration(): void "attempt" => 0, "lastError" => "[LASTERROR]", "lagDocuments" => 0, + "changelogWatermark" => 0, "verifiedAt" => "2020-10-15T06:38:00.000+00:00", "cutoverAt" => "2020-10-15T06:38:00.000+00:00", "soakUntil" => "2020-10-15T06:38:00.000+00:00", "autoCutover" => true, "cutoverRequested" => true, "paused" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -465,10 +453,9 @@ public function testMethodCreateMigration(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); } - public function testMethodGetMigration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -479,13 +466,14 @@ public function testMethodGetMigration(): void "attempt" => 0, "lastError" => "[LASTERROR]", "lagDocuments" => 0, + "changelogWatermark" => 0, "verifiedAt" => "2020-10-15T06:38:00.000+00:00", "cutoverAt" => "2020-10-15T06:38:00.000+00:00", "soakUntil" => "2020-10-15T06:38:00.000+00:00", "autoCutover" => true, "cutoverRequested" => true, "paused" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -501,7 +489,6 @@ public function testMethodGetMigration(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); } - public function testMethodDeleteMigration(): void { $data = ''; @@ -520,10 +507,9 @@ public function testMethodDeleteMigration(): void $this->assertSame($data, $response); } - public function testMethodCutoverMigration(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -534,13 +520,14 @@ public function testMethodCutoverMigration(): void "attempt" => 0, "lastError" => "[LASTERROR]", "lagDocuments" => 0, + "changelogWatermark" => 0, "verifiedAt" => "2020-10-15T06:38:00.000+00:00", "cutoverAt" => "2020-10-15T06:38:00.000+00:00", "soakUntil" => "2020-10-15T06:38:00.000+00:00", "autoCutover" => true, "cutoverRequested" => true, "paused" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -556,13 +543,12 @@ public function testMethodCutoverMigration(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseMigration::class, $response); } - public function testMethodListOperations(): void { - $data = array( + $data = [ "total" => 5, - "operations" => array( - array( + "operations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "databaseId" => "5e5ea5c16897e", @@ -571,9 +557,9 @@ public function testMethodListOperations(): void "attempts" => 1, "errorCode" => "Interrupted", "errorMessage" => "[ERRORMESSAGE]" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -588,23 +574,22 @@ public function testMethodListOperations(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseOperationList::class, $response); } - public function testMethodGetReplicas(): void { - $data = array( + $data = [ "replicas" => 2, "syncMode" => "async", "syncDegraded" => true, "syncAcknowledgements" => 1, "syncStandbyCount" => 2, - "members" => array( - array( + "members" => [ + [ "\$id" => "1", "role" => "replica", "status" => "active" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -619,39 +604,38 @@ public function testMethodGetReplicas(): void $this->assertInstanceOf(\Appwrite\Models\DedicatedDatabaseReplicas::class, $response); } - public function testMethodGetStatus(): void { - $data = array( + $data = [ "health" => "healthy", "ready" => true, "engine" => "postgresql", "version" => "17", "uptime" => 86400, - "connections" => array( + "connections" => [ "current" => 12, "max" => 100 - ), + ], "syncMode" => "async", "syncDegraded" => true, "syncAcknowledgements" => 1, "syncStandbyCount" => 2, - "replicas" => array( - array( + "replicas" => [ + [ "index" => 0, "role" => "primary", "healthy" => true - ) - ), - "volumes" => array( - array( + ] + ], + "volumes" => [ + [ "path" => "/var/lib/postgresql/data", "usedPercent" => "45%", "available" => "55GB", "mounted" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -666,24 +650,23 @@ public function testMethodGetStatus(): void $this->assertInstanceOf(\Appwrite\Models\DatabaseStatus::class, $response); } - public function testMethodListTables(): void { - $data = array( + $data = [ "total" => 5, - "tables" => array( - array( + "tables" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Table", "enabled" => true, "rowSecurity" => true, - "columns" => array(), - "indexes" => array( - array( + "columns" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -691,15 +674,15 @@ public function testMethodListTables(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ), + "columns" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -714,21 +697,20 @@ public function testMethodListTables(): void $this->assertInstanceOf(\Appwrite\Models\TableList::class, $response); } - public function testMethodCreateTable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Table", "enabled" => true, "rowSecurity" => true, - "columns" => array(), - "indexes" => array( - array( + "columns" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -736,13 +718,13 @@ public function testMethodCreateTable(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ), + "columns" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -759,21 +741,20 @@ public function testMethodCreateTable(): void $this->assertInstanceOf(\Appwrite\Models\Table::class, $response); } - public function testMethodGetTable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Table", "enabled" => true, "rowSecurity" => true, - "columns" => array(), - "indexes" => array( - array( + "columns" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -781,13 +762,13 @@ public function testMethodGetTable(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ), + "columns" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -803,21 +784,20 @@ public function testMethodGetTable(): void $this->assertInstanceOf(\Appwrite\Models\Table::class, $response); } - public function testMethodUpdateTable(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array(), + "\$permissions" => [], "databaseId" => "5e5ea5c16897e", "name" => "My Table", "enabled" => true, "rowSecurity" => true, - "columns" => array(), - "indexes" => array( - array( + "columns" => [], + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -825,13 +805,13 @@ public function testMethodUpdateTable(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ), + "columns" => [], + "lengths" => [] + ] + ], "bytesMax" => 65535, "bytesUsed" => 1500 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -847,7 +827,6 @@ public function testMethodUpdateTable(): void $this->assertInstanceOf(\Appwrite\Models\Table::class, $response); } - public function testMethodDeleteTable(): void { $data = ''; @@ -866,13 +845,12 @@ public function testMethodDeleteTable(): void $this->assertSame($data, $response); } - public function testMethodListColumns(): void { - $data = array( + $data = [ "total" => 5, - "columns" => array() - ); + "columns" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -888,10 +866,9 @@ public function testMethodListColumns(): void $this->assertInstanceOf(\Appwrite\Models\ColumnList::class, $response); } - public function testMethodCreateBigIntColumn(): void { - $data = array( + $data = [ "key" => "count", "type" => "bigint", "status" => "available", @@ -899,7 +876,7 @@ public function testMethodCreateBigIntColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -917,10 +894,9 @@ public function testMethodCreateBigIntColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnBigint::class, $response); } - public function testMethodUpdateBigIntColumn(): void { - $data = array( + $data = [ "key" => "count", "type" => "bigint", "status" => "available", @@ -928,7 +904,7 @@ public function testMethodUpdateBigIntColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -947,10 +923,9 @@ public function testMethodUpdateBigIntColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnBigint::class, $response); } - public function testMethodCreateBooleanColumn(): void { - $data = array( + $data = [ "key" => "isEnabled", "type" => "boolean", "status" => "available", @@ -958,7 +933,7 @@ public function testMethodCreateBooleanColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -976,10 +951,9 @@ public function testMethodCreateBooleanColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnBoolean::class, $response); } - public function testMethodUpdateBooleanColumn(): void { - $data = array( + $data = [ "key" => "isEnabled", "type" => "boolean", "status" => "available", @@ -987,7 +961,7 @@ public function testMethodUpdateBooleanColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1006,10 +980,9 @@ public function testMethodUpdateBooleanColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnBoolean::class, $response); } - public function testMethodCreateDatetimeColumn(): void { - $data = array( + $data = [ "key" => "birthDay", "type" => "datetime", "status" => "available", @@ -1018,7 +991,7 @@ public function testMethodCreateDatetimeColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1036,10 +1009,9 @@ public function testMethodCreateDatetimeColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnDatetime::class, $response); } - public function testMethodUpdateDatetimeColumn(): void { - $data = array( + $data = [ "key" => "birthDay", "type" => "datetime", "status" => "available", @@ -1048,7 +1020,7 @@ public function testMethodUpdateDatetimeColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "datetime" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1067,10 +1039,9 @@ public function testMethodUpdateDatetimeColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnDatetime::class, $response); } - public function testMethodCreateEmailColumn(): void { - $data = array( + $data = [ "key" => "userEmail", "type" => "string", "status" => "available", @@ -1079,7 +1050,7 @@ public function testMethodCreateEmailColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1097,10 +1068,9 @@ public function testMethodCreateEmailColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnEmail::class, $response); } - public function testMethodUpdateEmailColumn(): void { - $data = array( + $data = [ "key" => "userEmail", "type" => "string", "status" => "available", @@ -1109,7 +1079,7 @@ public function testMethodUpdateEmailColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "email" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1128,10 +1098,9 @@ public function testMethodUpdateEmailColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnEmail::class, $response); } - public function testMethodCreateEnumColumn(): void { - $data = array( + $data = [ "key" => "status", "type" => "string", "status" => "available", @@ -1139,9 +1108,9 @@ public function testMethodCreateEnumColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "elements" => array(), + "elements" => [], "format" => "enum" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1154,16 +1123,15 @@ public function testMethodCreateEnumColumn(): void "", "", "", - array(), + [], true ); $this->assertInstanceOf(\Appwrite\Models\ColumnEnum::class, $response); } - public function testMethodUpdateEnumColumn(): void { - $data = array( + $data = [ "key" => "status", "type" => "string", "status" => "available", @@ -1171,9 +1139,9 @@ public function testMethodUpdateEnumColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "elements" => array(), + "elements" => [], "format" => "enum" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1186,17 +1154,16 @@ public function testMethodUpdateEnumColumn(): void "", "", "", - array(), + [], true, "" ); $this->assertInstanceOf(\Appwrite\Models\ColumnEnum::class, $response); } - public function testMethodCreateFloatColumn(): void { - $data = array( + $data = [ "key" => "percentageCompleted", "type" => "double", "status" => "available", @@ -1204,7 +1171,7 @@ public function testMethodCreateFloatColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1222,10 +1189,9 @@ public function testMethodCreateFloatColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnFloat::class, $response); } - public function testMethodUpdateFloatColumn(): void { - $data = array( + $data = [ "key" => "percentageCompleted", "type" => "double", "status" => "available", @@ -1233,7 +1199,7 @@ public function testMethodUpdateFloatColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1252,10 +1218,9 @@ public function testMethodUpdateFloatColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnFloat::class, $response); } - public function testMethodCreateIntegerColumn(): void { - $data = array( + $data = [ "key" => "count", "type" => "integer", "status" => "available", @@ -1263,7 +1228,7 @@ public function testMethodCreateIntegerColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1281,10 +1246,9 @@ public function testMethodCreateIntegerColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnInteger::class, $response); } - public function testMethodUpdateIntegerColumn(): void { - $data = array( + $data = [ "key" => "count", "type" => "integer", "status" => "available", @@ -1292,7 +1256,7 @@ public function testMethodUpdateIntegerColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1311,10 +1275,9 @@ public function testMethodUpdateIntegerColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnInteger::class, $response); } - public function testMethodCreateIpColumn(): void { - $data = array( + $data = [ "key" => "ipAddress", "type" => "string", "status" => "available", @@ -1323,7 +1286,7 @@ public function testMethodCreateIpColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1341,10 +1304,9 @@ public function testMethodCreateIpColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnIp::class, $response); } - public function testMethodUpdateIpColumn(): void { - $data = array( + $data = [ "key" => "ipAddress", "type" => "string", "status" => "available", @@ -1353,7 +1315,7 @@ public function testMethodUpdateIpColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "ip" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1372,10 +1334,9 @@ public function testMethodUpdateIpColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnIp::class, $response); } - public function testMethodCreateLineColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1383,7 +1344,7 @@ public function testMethodCreateLineColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1401,10 +1362,9 @@ public function testMethodCreateLineColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnLine::class, $response); } - public function testMethodUpdateLineColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1412,7 +1372,7 @@ public function testMethodUpdateLineColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1430,10 +1390,9 @@ public function testMethodUpdateLineColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnLine::class, $response); } - public function testMethodCreateLongtextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1441,7 +1400,7 @@ public function testMethodCreateLongtextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1459,10 +1418,9 @@ public function testMethodCreateLongtextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnLongtext::class, $response); } - public function testMethodUpdateLongtextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1470,7 +1428,7 @@ public function testMethodUpdateLongtextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1489,10 +1447,9 @@ public function testMethodUpdateLongtextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnLongtext::class, $response); } - public function testMethodCreateMediumtextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1500,7 +1457,7 @@ public function testMethodCreateMediumtextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1518,10 +1475,9 @@ public function testMethodCreateMediumtextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnMediumtext::class, $response); } - public function testMethodUpdateMediumtextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1529,7 +1485,7 @@ public function testMethodUpdateMediumtextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1548,10 +1504,9 @@ public function testMethodUpdateMediumtextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnMediumtext::class, $response); } - public function testMethodCreatePointColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1559,7 +1514,7 @@ public function testMethodCreatePointColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1577,10 +1532,9 @@ public function testMethodCreatePointColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnPoint::class, $response); } - public function testMethodUpdatePointColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1588,7 +1542,7 @@ public function testMethodUpdatePointColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1606,10 +1560,9 @@ public function testMethodUpdatePointColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnPoint::class, $response); } - public function testMethodCreatePolygonColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1617,7 +1570,7 @@ public function testMethodCreatePolygonColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1635,10 +1588,9 @@ public function testMethodCreatePolygonColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnPolygon::class, $response); } - public function testMethodUpdatePolygonColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1646,7 +1598,7 @@ public function testMethodUpdatePolygonColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1664,10 +1616,9 @@ public function testMethodUpdatePolygonColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnPolygon::class, $response); } - public function testMethodCreateRelationshipColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1681,7 +1632,7 @@ public function testMethodCreateRelationshipColumn(): void "twoWayKey" => "string", "onDelete" => "restrict|cascade|setNull", "side" => "parent|child" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1699,10 +1650,9 @@ public function testMethodCreateRelationshipColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnRelationship::class, $response); } - public function testMethodCreateStringColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1711,7 +1661,7 @@ public function testMethodCreateStringColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1730,10 +1680,9 @@ public function testMethodCreateStringColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnString::class, $response); } - public function testMethodUpdateStringColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1742,7 +1691,7 @@ public function testMethodUpdateStringColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1761,10 +1710,9 @@ public function testMethodUpdateStringColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnString::class, $response); } - public function testMethodCreateTextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1772,7 +1720,7 @@ public function testMethodCreateTextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1790,10 +1738,9 @@ public function testMethodCreateTextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnText::class, $response); } - public function testMethodUpdateTextColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1801,7 +1748,7 @@ public function testMethodUpdateTextColumn(): void "required" => true, "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1820,10 +1767,9 @@ public function testMethodUpdateTextColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnText::class, $response); } - public function testMethodCreateUrlColumn(): void { - $data = array( + $data = [ "key" => "githubUrl", "type" => "string", "status" => "available", @@ -1832,7 +1778,7 @@ public function testMethodCreateUrlColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1850,10 +1796,9 @@ public function testMethodCreateUrlColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnUrl::class, $response); } - public function testMethodUpdateUrlColumn(): void { - $data = array( + $data = [ "key" => "githubUrl", "type" => "string", "status" => "available", @@ -1862,7 +1807,7 @@ public function testMethodUpdateUrlColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "format" => "url" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1881,10 +1826,9 @@ public function testMethodUpdateUrlColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnUrl::class, $response); } - public function testMethodCreateVarcharColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1893,7 +1837,7 @@ public function testMethodCreateVarcharColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1912,10 +1856,9 @@ public function testMethodCreateVarcharColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnVarchar::class, $response); } - public function testMethodUpdateVarcharColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1924,7 +1867,7 @@ public function testMethodUpdateVarcharColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1943,11 +1886,10 @@ public function testMethodUpdateVarcharColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnVarchar::class, $response); } - public function testMethodGetColumn(): void { $data = array_replace( - array( + [ "key" => "fullName", "type" => "string", "status" => "available", @@ -1956,10 +1898,10 @@ public function testMethodGetColumn(): void "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "size" => 128 - ), - array( + ], + [ "type" => "string" - ) + ] ); $this->client @@ -1977,7 +1919,6 @@ public function testMethodGetColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnString::class, $response); } - public function testMethodDeleteColumn(): void { $data = ''; @@ -1997,10 +1938,9 @@ public function testMethodDeleteColumn(): void $this->assertSame($data, $response); } - public function testMethodUpdateRelationshipColumn(): void { - $data = array( + $data = [ "key" => "fullName", "type" => "string", "status" => "available", @@ -2014,7 +1954,7 @@ public function testMethodUpdateRelationshipColumn(): void "twoWayKey" => "string", "onDelete" => "restrict|cascade|setNull", "side" => "parent|child" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2031,13 +1971,12 @@ public function testMethodUpdateRelationshipColumn(): void $this->assertInstanceOf(\Appwrite\Models\ColumnRelationship::class, $response); } - public function testMethodListIndexes(): void { - $data = array( + $data = [ "total" => 5, - "indexes" => array( - array( + "indexes" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2045,11 +1984,11 @@ public function testMethodListIndexes(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ) - ) - ); + "columns" => [], + "lengths" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2065,10 +2004,9 @@ public function testMethodListIndexes(): void $this->assertInstanceOf(\Appwrite\Models\ColumnIndexList::class, $response); } - public function testMethodCreateIndex(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2076,9 +2014,9 @@ public function testMethodCreateIndex(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ); + "columns" => [], + "lengths" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2092,15 +2030,14 @@ public function testMethodCreateIndex(): void "", "", TablesDBIndexType::KEY(), - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\ColumnIndex::class, $response); } - public function testMethodGetIndex(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -2108,9 +2045,9 @@ public function testMethodGetIndex(): void "type" => "primary", "status" => "available", "error" => "string", - "columns" => array(), - "lengths" => array() - ); + "columns" => [], + "lengths" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2127,7 +2064,6 @@ public function testMethodGetIndex(): void $this->assertInstanceOf(\Appwrite\Models\ColumnIndex::class, $response); } - public function testMethodDeleteIndex(): void { $data = ''; @@ -2147,23 +2083,22 @@ public function testMethodDeleteIndex(): void $this->assertSame($data, $response); } - public function testMethodListRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2179,18 +2114,17 @@ public function testMethodListRows(): void $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodCreateRow(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2203,28 +2137,27 @@ public function testMethodCreateRow(): void "", "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodCreateRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2236,28 +2169,27 @@ public function testMethodCreateRows(): void $response = $this->tablesDB->createRows( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodUpsertRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2269,28 +2201,27 @@ public function testMethodUpsertRows(): void $response = $this->tablesDB->upsertRows( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodUpdateRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2306,23 +2237,22 @@ public function testMethodUpdateRows(): void $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodDeleteRows(): void { - $data = array( + $data = [ "total" => 5, - "rows" => array( - array( + "rows" => [ + [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ) - ) - ); + "\$permissions" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2338,18 +2268,17 @@ public function testMethodDeleteRows(): void $this->assertInstanceOf(\Appwrite\Models\RowList::class, $response); } - public function testMethodGetRow(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2366,18 +2295,17 @@ public function testMethodGetRow(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodUpsertRow(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2394,18 +2322,17 @@ public function testMethodUpsertRow(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodUpdateRow(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2422,7 +2349,6 @@ public function testMethodUpdateRow(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodDeleteRow(): void { $data = ''; @@ -2442,18 +2368,17 @@ public function testMethodDeleteRow(): void $this->assertSame($data, $response); } - public function testMethodDecrementRowColumn(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2471,18 +2396,17 @@ public function testMethodDecrementRowColumn(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - public function testMethodIncrementRowColumn(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$sequence" => "1", "\$tableId" => "5e5ea5c15117e", "\$databaseId" => "5e5ea5c15117e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", - "\$permissions" => array() - ); + "\$permissions" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -2500,5 +2424,4 @@ public function testMethodIncrementRowColumn(): void $this->assertInstanceOf(\Appwrite\Models\Row::class, $response); } - } diff --git a/tests/Appwrite/Services/TeamsTest.php b/tests/Appwrite/Services/TeamsTest.php index 376e81d1..63a1967f 100644 --- a/tests/Appwrite/Services/TeamsTest.php +++ b/tests/Appwrite/Services/TeamsTest.php @@ -1,16 +1,18 @@ 5, - "teams" => array( - array( + "teams" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array() - ) - ) - ); + "prefs" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -45,17 +47,16 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\TeamList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array() - ); + "prefs" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -71,17 +72,16 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\Team::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array() - ); + "prefs" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -96,17 +96,16 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Team::class, $response); } - public function testMethodUpdateName(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "VIP", "total" => 7, - "prefs" => array() - ); + "prefs" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -122,7 +121,6 @@ public function testMethodUpdateName(): void $this->assertInstanceOf(\Appwrite\Models\Team::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -140,25 +138,24 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodListInstallations(): void { - $data = array( + $data = [ "total" => 5, - "installations" => array( - array( + "installations" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -173,20 +170,19 @@ public function testMethodListInstallations(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallationList::class, $response); } - public function testMethodCreateInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -202,20 +198,19 @@ public function testMethodCreateInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodGetInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -231,20 +226,19 @@ public function testMethodGetInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodUpdateInstallation(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "appId" => "5e5ea5c16897e", "teamId" => "5e5ea5c16897e", - "scopes" => array(), - "authorizationDetails" => array(), + "scopes" => [], + "authorizationDetails" => [], "createdById" => "5e5ea5c16897e", "createdByName" => "Walter White" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -260,7 +254,6 @@ public function testMethodUpdateInstallation(): void $this->assertInstanceOf(\Appwrite\Models\AppInstallation::class, $response); } - public function testMethodDeleteInstallation(): void { $data = ''; @@ -279,13 +272,12 @@ public function testMethodDeleteInstallation(): void $this->assertSame($data, $response); } - public function testMethodListMemberships(): void { - $data = array( + $data = [ "total" => 5, - "memberships" => array( - array( + "memberships" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -300,10 +292,10 @@ public function testMethodListMemberships(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ) - ) - ); + "roles" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -318,10 +310,9 @@ public function testMethodListMemberships(): void $this->assertInstanceOf(\Appwrite\Models\MembershipList::class, $response); } - public function testMethodCreateMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -336,8 +327,8 @@ public function testMethodCreateMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -348,15 +339,14 @@ public function testMethodCreateMembership(): void $response = $this->teams->createMembership( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodGetMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -371,8 +361,8 @@ public function testMethodGetMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -388,10 +378,9 @@ public function testMethodGetMembership(): void $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodUpdateMembership(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -406,8 +395,8 @@ public function testMethodUpdateMembership(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -419,12 +408,11 @@ public function testMethodUpdateMembership(): void $response = $this->teams->updateMembership( "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodDeleteMembership(): void { $data = ''; @@ -443,10 +431,9 @@ public function testMethodDeleteMembership(): void $this->assertSame($data, $response); } - public function testMethodUpdateMembershipStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -461,8 +448,8 @@ public function testMethodUpdateMembershipStatus(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ); + "roles" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -480,10 +467,9 @@ public function testMethodUpdateMembershipStatus(): void $this->assertInstanceOf(\Appwrite\Models\Membership::class, $response); } - public function testMethodGetPrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -498,10 +484,9 @@ public function testMethodGetPrefs(): void $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - public function testMethodUpdatePrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -512,10 +497,9 @@ public function testMethodUpdatePrefs(): void $response = $this->teams->updatePrefs( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - } diff --git a/tests/Appwrite/Services/TokensTest.php b/tests/Appwrite/Services/TokensTest.php index e20f6441..630684d7 100644 --- a/tests/Appwrite/Services/TokensTest.php +++ b/tests/Appwrite/Services/TokensTest.php @@ -1,16 +1,18 @@ 5, - "tokens" => array( - array( + "tokens" => [ + [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", @@ -31,9 +33,9 @@ public function testMethodList(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -49,10 +51,9 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\ResourceTokenList::class, $response); } - public function testMethodCreateFileToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", @@ -60,7 +61,7 @@ public function testMethodCreateFileToken(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -76,10 +77,9 @@ public function testMethodCreateFileToken(): void $this->assertInstanceOf(\Appwrite\Models\ResourceToken::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", @@ -87,7 +87,7 @@ public function testMethodGet(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -102,10 +102,9 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\ResourceToken::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "resourceId" => "5e5ea5c168bb8:5e5ea5c168bb8", @@ -113,7 +112,7 @@ public function testMethodUpdate(): void "expire" => "2020-10-15T06:38:00.000+00:00", "secret" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -128,7 +127,6 @@ public function testMethodUpdate(): void $this->assertInstanceOf(\Appwrite\Models\ResourceToken::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -146,5 +144,4 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - } diff --git a/tests/Appwrite/Services/UsersTest.php b/tests/Appwrite/Services/UsersTest.php index 6206a767..ce365d4f 100644 --- a/tests/Appwrite/Services/UsersTest.php +++ b/tests/Appwrite/Services/UsersTest.php @@ -1,19 +1,20 @@ 5, - "users" => array( - array( + "users" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -51,12 +52,12 @@ public function testMethodList(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -69,26 +70,25 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\UserList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -97,10 +97,10 @@ public function testMethodCreate(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -115,26 +115,25 @@ public function testMethodCreate(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateArgon2User(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -143,10 +142,10 @@ public function testMethodCreateArgon2User(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -163,26 +162,25 @@ public function testMethodCreateArgon2User(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateBcryptUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -191,10 +189,10 @@ public function testMethodCreateBcryptUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -211,13 +209,12 @@ public function testMethodCreateBcryptUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListIdentities(): void { - $data = array( + $data = [ "total" => 5, - "identities" => array( - array( + "identities" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -228,9 +225,9 @@ public function testMethodListIdentities(): void "providerAccessToken" => "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", "providerAccessTokenExpiry" => "2020-10-15T06:38:00.000+00:00", "providerRefreshToken" => "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -243,7 +240,6 @@ public function testMethodListIdentities(): void $this->assertInstanceOf(\Appwrite\Models\IdentityList::class, $response); } - public function testMethodDeleteIdentity(): void { $data = ''; @@ -261,26 +257,25 @@ public function testMethodDeleteIdentity(): void $this->assertSame($data, $response); } - public function testMethodCreateMD5User(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -289,10 +284,10 @@ public function testMethodCreateMD5User(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -309,26 +304,25 @@ public function testMethodCreateMD5User(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreatePHPassUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -337,10 +331,10 @@ public function testMethodCreatePHPassUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -357,26 +351,25 @@ public function testMethodCreatePHPassUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateScryptUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -385,10 +378,10 @@ public function testMethodCreateScryptUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -410,26 +403,25 @@ public function testMethodCreateScryptUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateScryptModifiedUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -438,10 +430,10 @@ public function testMethodCreateScryptModifiedUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -461,26 +453,25 @@ public function testMethodCreateScryptModifiedUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateSHAUser(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -489,10 +480,10 @@ public function testMethodCreateSHAUser(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -509,26 +500,25 @@ public function testMethodCreateSHAUser(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -537,10 +527,10 @@ public function testMethodGet(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -555,7 +545,6 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -573,26 +562,25 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateEmail(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -601,10 +589,10 @@ public function testMethodUpdateEmail(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -620,26 +608,25 @@ public function testMethodUpdateEmail(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdateImpersonator(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -648,10 +635,10 @@ public function testMethodUpdateImpersonator(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -667,12 +654,11 @@ public function testMethodUpdateImpersonator(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodCreateJWT(): void { - $data = array( + $data = [ "jwt" => "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -687,26 +673,25 @@ public function testMethodCreateJWT(): void $this->assertInstanceOf(\Appwrite\Models\Jwt::class, $response); } - public function testMethodUpdateLabels(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -715,10 +700,10 @@ public function testMethodUpdateLabels(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -729,18 +714,17 @@ public function testMethodUpdateLabels(): void $response = $this->users->updateLabels( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListLogs(): void { - $data = array( + $data = [ "total" => 5, - "logs" => array( - array( + "logs" => [ + [ "event" => "account.sessions.create", "userId" => "610fc2f985ee0", "userEmail" => "john@appwrite.io", @@ -763,9 +747,9 @@ public function testMethodListLogs(): void "deviceModel" => "Nexus 5", "countryCode" => "US", "countryName" => "United States" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -780,13 +764,12 @@ public function testMethodListLogs(): void $this->assertInstanceOf(\Appwrite\Models\LogList::class, $response); } - public function testMethodListMemberships(): void { - $data = array( + $data = [ "total" => 5, - "memberships" => array( - array( + "memberships" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -801,10 +784,10 @@ public function testMethodListMemberships(): void "confirm" => true, "mfa" => true, "userAccessedAt" => "2020-10-15T06:38:00.000+00:00", - "roles" => array() - ) - ) - ); + "roles" => [] + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -819,26 +802,25 @@ public function testMethodListMemberships(): void $this->assertInstanceOf(\Appwrite\Models\MembershipList::class, $response); } - public function testMethodUpdateMFA(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -847,10 +829,10 @@ public function testMethodUpdateMFA(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -866,7 +848,6 @@ public function testMethodUpdateMFA(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodDeleteMFAAuthenticator(): void { $data = ''; @@ -885,16 +866,15 @@ public function testMethodDeleteMFAAuthenticator(): void $this->assertSame($data, $response); } - public function testMethodGetMFAChallenge(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "expire" => "2020-10-15T06:38:00.000+00:00", "code" => "446372" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -910,16 +890,15 @@ public function testMethodGetMFAChallenge(): void $this->assertInstanceOf(\Appwrite\Models\MfaChallengeSecret::class, $response); } - public function testMethodListMFAFactors(): void { - $data = array( + $data = [ "totp" => true, "phone" => true, "email" => true, "recoveryCode" => true, "custom" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -934,12 +913,11 @@ public function testMethodListMFAFactors(): void $this->assertInstanceOf(\Appwrite\Models\MfaFactors::class, $response); } - public function testMethodGetMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -954,12 +932,11 @@ public function testMethodGetMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodUpdateMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -974,12 +951,11 @@ public function testMethodUpdateMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodCreateMFARecoveryCodes(): void { - $data = array( - "recoveryCodes" => array() - ); + $data = [ + "recoveryCodes" => [] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -994,26 +970,25 @@ public function testMethodCreateMFARecoveryCodes(): void $this->assertInstanceOf(\Appwrite\Models\MfaRecoveryCodes::class, $response); } - public function testMethodUpdateName(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1022,10 +997,10 @@ public function testMethodUpdateName(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1041,26 +1016,25 @@ public function testMethodUpdateName(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePassword(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1069,10 +1043,10 @@ public function testMethodUpdatePassword(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1088,26 +1062,25 @@ public function testMethodUpdatePassword(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePhone(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1116,10 +1089,10 @@ public function testMethodUpdatePhone(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1135,10 +1108,9 @@ public function testMethodUpdatePhone(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodGetPrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1153,10 +1125,9 @@ public function testMethodGetPrefs(): void $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - public function testMethodUpdatePrefs(): void { - $data = array(); + $data = []; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1167,18 +1138,17 @@ public function testMethodUpdatePrefs(): void $response = $this->users->updatePrefs( "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Preferences::class, $response); } - public function testMethodListSessions(): void { - $data = array( + $data = [ "total" => 5, - "sessions" => array( - array( + "sessions" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1205,12 +1175,12 @@ public function testMethodListSessions(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1225,10 +1195,9 @@ public function testMethodListSessions(): void $this->assertInstanceOf(\Appwrite\Models\SessionList::class, $response); } - public function testMethodCreateSession(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1255,10 +1224,10 @@ public function testMethodCreateSession(): void "countryCode" => "US", "countryName" => "United States", "current" => true, - "factors" => array(), + "factors" => [], "secret" => "5e5bb8c16897e", "mfaUpdatedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1273,7 +1242,6 @@ public function testMethodCreateSession(): void $this->assertInstanceOf(\Appwrite\Models\Session::class, $response); } - public function testMethodDeleteSessions(): void { $data = ''; @@ -1291,7 +1259,6 @@ public function testMethodDeleteSessions(): void $this->assertSame($data, $response); } - public function testMethodDeleteSession(): void { $data = ''; @@ -1310,26 +1277,25 @@ public function testMethodDeleteSession(): void $this->assertSame($data, $response); } - public function testMethodUpdateStatus(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1338,10 +1304,10 @@ public function testMethodUpdateStatus(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1357,13 +1323,12 @@ public function testMethodUpdateStatus(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodListTargets(): void { - $data = array( + $data = [ "total" => 5, - "targets" => array( - array( + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1372,9 +1337,9 @@ public function testMethodListTargets(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1389,10 +1354,9 @@ public function testMethodListTargets(): void $this->assertInstanceOf(\Appwrite\Models\TargetList::class, $response); } - public function testMethodCreateTarget(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1401,7 +1365,7 @@ public function testMethodCreateTarget(): void "providerType" => "email", "identifier" => "token", "expired" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1419,10 +1383,9 @@ public function testMethodCreateTarget(): void $this->assertInstanceOf(\Appwrite\Models\Target::class, $response); } - public function testMethodGetTarget(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1431,7 +1394,7 @@ public function testMethodGetTarget(): void "providerType" => "email", "identifier" => "token", "expired" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1447,10 +1410,9 @@ public function testMethodGetTarget(): void $this->assertInstanceOf(\Appwrite\Models\Target::class, $response); } - public function testMethodUpdateTarget(): void { - $data = array( + $data = [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1459,7 +1421,7 @@ public function testMethodUpdateTarget(): void "providerType" => "email", "identifier" => "token", "expired" => true - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1475,7 +1437,6 @@ public function testMethodUpdateTarget(): void $this->assertInstanceOf(\Appwrite\Models\Target::class, $response); } - public function testMethodDeleteTarget(): void { $data = ''; @@ -1494,17 +1455,16 @@ public function testMethodDeleteTarget(): void $this->assertSame($data, $response); } - public function testMethodCreateToken(): void { - $data = array( + $data = [ "\$id" => "bb8ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "userId" => "5e5ea5c168bb8", "secret" => "[SECRET]", "expire" => "2020-10-15T06:38:00.000+00:00", "phrase" => "Golden Fox" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1519,26 +1479,25 @@ public function testMethodCreateToken(): void $this->assertInstanceOf(\Appwrite\Models\Token::class, $response); } - public function testMethodUpdateEmailVerification(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1547,10 +1506,10 @@ public function testMethodUpdateEmailVerification(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1566,26 +1525,25 @@ public function testMethodUpdateEmailVerification(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - public function testMethodUpdatePhoneVerification(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "John Doe", "registration" => "2020-10-15T06:38:00.000+00:00", "status" => true, - "labels" => array(), + "labels" => [], "passwordUpdate" => "2020-10-15T06:38:00.000+00:00", "email" => "john@appwrite.io", "phone" => "+4930901820", "emailVerification" => true, "phoneVerification" => true, "mfa" => true, - "prefs" => array(), - "targets" => array( - array( + "prefs" => [], + "targets" => [ + [ "\$id" => "259125845563242502", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", @@ -1594,10 +1552,10 @@ public function testMethodUpdatePhoneVerification(): void "providerType" => "email", "identifier" => "token", "expired" => true - ) - ), + ] + ], "accessedAt" => "2020-10-15T06:38:00.000+00:00" - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -1613,5 +1571,4 @@ public function testMethodUpdatePhoneVerification(): void $this->assertInstanceOf(\Appwrite\Models\User::class, $response); } - } diff --git a/tests/Appwrite/Services/WebhooksTest.php b/tests/Appwrite/Services/WebhooksTest.php index c8513b7c..677b145e 100644 --- a/tests/Appwrite/Services/WebhooksTest.php +++ b/tests/Appwrite/Services/WebhooksTest.php @@ -1,16 +1,18 @@ 5, - "webhooks" => array( - array( + "webhooks" => [ + [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -37,9 +39,9 @@ public function testMethodList(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ) - ) - ); + ] + ] + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -52,16 +54,15 @@ public function testMethodList(): void $this->assertInstanceOf(\Appwrite\Models\WebhookList::class, $response); } - public function testMethodCreate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -69,7 +70,7 @@ public function testMethodCreate(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -82,21 +83,20 @@ public function testMethodCreate(): void "", "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Webhook::class, $response); } - public function testMethodGet(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -104,7 +104,7 @@ public function testMethodGet(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -119,16 +119,15 @@ public function testMethodGet(): void $this->assertInstanceOf(\Appwrite\Models\Webhook::class, $response); } - public function testMethodUpdate(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -136,7 +135,7 @@ public function testMethodUpdate(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -149,12 +148,11 @@ public function testMethodUpdate(): void "", "", "", - array() + [] ); $this->assertInstanceOf(\Appwrite\Models\Webhook::class, $response); } - public function testMethodDelete(): void { $data = ''; @@ -172,16 +170,15 @@ public function testMethodDelete(): void $this->assertSame($data, $response); } - public function testMethodUpdateSecret(): void { - $data = array( + $data = [ "\$id" => "5e5ea5c16897e", "\$createdAt" => "2020-10-15T06:38:00.000+00:00", "\$updatedAt" => "2020-10-15T06:38:00.000+00:00", "name" => "My Webhook", "url" => "https://example.com/webhook", - "events" => array(), + "events" => [], "tls" => true, "authUsername" => "username", "authPassword" => "webhook-password", @@ -189,7 +186,7 @@ public function testMethodUpdateSecret(): void "enabled" => true, "logs" => "Failed to connect to remote server.", "attempts" => 10 - ); + ]; $this->client ->allows()->call(Mockery::any(), Mockery::any(), Mockery::any(), Mockery::any()) @@ -204,5 +201,4 @@ public function testMethodUpdateSecret(): void $this->assertInstanceOf(\Appwrite\Models\Webhook::class, $response); } - }