diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index afbd520..3eca34f 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -37,11 +37,11 @@ class Client */ protected $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/9.0.0 ()', + 'user-agent' => 'AppwritePHPSDK/9.0.1 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '9.0.0', + 'x-sdk-version'=> '9.0.1', ]; /** diff --git a/src/Appwrite/Role.php b/src/Appwrite/Role.php index 46989d3..2cc3ffb 100644 --- a/src/Appwrite/Role.php +++ b/src/Appwrite/Role.php @@ -2,12 +2,33 @@ namespace Appwrite; +/** + * Helper class to generate role strings for Permission. + */ class Role { + /** + * Grants access to anyone. + * + * This includes authenticated and unauthenticated users. + * + * @return string + */ public static function any(): string { return 'any'; } + + /** + * Grants access to a specific user by user ID. + * + * You can optionally pass verified or unverified for + * `status` to target specific types of users. + * + * @param string $id + * @param string $status + * @return string + */ public static function user(string $id, string $status = ""): string { if(empty($status)) { @@ -15,6 +36,16 @@ public static function user(string $id, string $status = ""): string } return "user:$id/$status"; } + + /** + * Grants access to any authenticated or anonymous user. + * + * You can optionally pass verified or unverified for + * `status` to target specific types of users. + * + * @param string $status + * @return string + */ public static function users(string $status = ""): string { if(empty($status)) { @@ -22,10 +53,29 @@ public static function users(string $status = ""): string } return "users/$status"; } + + /** + * Grants access to any guest user without a session. + * + * Authenticated users don't have access to this role. + * + * @return string + */ public static function guests(): string { return 'guests'; } + + /** + * Grants access to a team by team ID. + * + * You can optionally pass a role for `role` to target + * team members with the specified role. + * + * @param string $id + * @param string $role + * @return string + */ public static function team(string $id, string $role = ""): string { if(empty($role)) { @@ -33,8 +83,29 @@ public static function team(string $id, string $role = ""): string } return "team:$id/$role"; } + + /** + * Grants access to a specific member of a team. + * + * When the member is removed from the team, they will + * no longer have access. + * + * @param string $id + * @return string + */ public static function member(string $id): string { return "member:$id"; } + + /** + * Grants access to a user with the specified label. + * + * @param string $name + * @return string + */ + public static function label(string $name): string + { + return "label:$name"; + } } \ No newline at end of file diff --git a/src/Appwrite/Services/Account.php b/src/Appwrite/Services/Account.php index 683aa18..fdea3ff 100644 --- a/src/Appwrite/Services/Account.php +++ b/src/Appwrite/Services/Account.php @@ -27,11 +27,11 @@ public function get(): array { $apiPath = str_replace([], [], '/account'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -56,7 +56,7 @@ public function updateEmail(string $email, string $password): array { $apiPath = str_replace([], [], '/account/email'); - $params = []; + $apiParams = []; if (!isset($email)) { throw new AppwriteException('Missing required parameter: "email"'); } @@ -64,17 +64,17 @@ public function updateEmail(string $email, string $password): array throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -91,15 +91,15 @@ public function listIdentities(string $queries = null): array { $apiPath = str_replace([], [], '/account/identities'); - $params = []; + $apiParams = []; if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -116,14 +116,14 @@ public function deleteIdentity(string $identityId): string { $apiPath = str_replace(['{identityId}'], [$identityId], '/account/identities/{identityId}'); - $params = []; + $apiParams = []; if (!isset($identityId)) { throw new AppwriteException('Missing required parameter: "identityId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -141,15 +141,15 @@ public function listLogs(array $queries = null): array { $apiPath = str_replace([], [], '/account/logs'); - $params = []; + $apiParams = []; if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -166,18 +166,18 @@ public function updateName(string $name): array { $apiPath = str_replace([], [], '/account/name'); - $params = []; + $apiParams = []; if (!isset($name)) { throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -197,22 +197,22 @@ public function updatePassword(string $password, string $oldPassword = null): ar { $apiPath = str_replace([], [], '/account/password'); - $params = []; + $apiParams = []; if (!isset($password)) { throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($oldPassword)) { - $params['oldPassword'] = $oldPassword; + $apiParams['oldPassword'] = $oldPassword; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -234,7 +234,7 @@ public function updatePhone(string $phone, string $password): array { $apiPath = str_replace([], [], '/account/phone'); - $params = []; + $apiParams = []; if (!isset($phone)) { throw new AppwriteException('Missing required parameter: "phone"'); } @@ -242,17 +242,17 @@ public function updatePhone(string $phone, string $password): array throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($phone)) { - $params['phone'] = $phone; + $apiParams['phone'] = $phone; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -268,11 +268,11 @@ public function getPrefs(): array { $apiPath = str_replace([], [], '/account/prefs'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -291,18 +291,18 @@ public function updatePrefs(array $prefs): array { $apiPath = str_replace([], [], '/account/prefs'); - $params = []; + $apiParams = []; if (!isset($prefs)) { throw new AppwriteException('Missing required parameter: "prefs"'); } if (!is_null($prefs)) { - $params['prefs'] = $prefs; + $apiParams['prefs'] = $prefs; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -327,7 +327,7 @@ public function createRecovery(string $email, string $url): array { $apiPath = str_replace([], [], '/account/recovery'); - $params = []; + $apiParams = []; if (!isset($email)) { throw new AppwriteException('Missing required parameter: "email"'); } @@ -335,17 +335,17 @@ public function createRecovery(string $email, string $url): array throw new AppwriteException('Missing required parameter: "url"'); } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($url)) { - $params['url'] = $url; + $apiParams['url'] = $url; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -373,7 +373,7 @@ public function updateRecovery(string $userId, string $secret, string $password, { $apiPath = str_replace([], [], '/account/recovery'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -387,25 +387,25 @@ public function updateRecovery(string $userId, string $secret, string $password, throw new AppwriteException('Missing required parameter: "passwordAgain"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($secret)) { - $params['secret'] = $secret; + $apiParams['secret'] = $secret; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($passwordAgain)) { - $params['passwordAgain'] = $passwordAgain; + $apiParams['passwordAgain'] = $passwordAgain; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -422,11 +422,11 @@ public function listSessions(): array { $apiPath = str_replace([], [], '/account/sessions'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -443,11 +443,11 @@ public function deleteSessions(): string { $apiPath = str_replace([], [], '/account/sessions'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -465,14 +465,14 @@ public function getSession(string $sessionId): array { $apiPath = str_replace(['{sessionId}'], [$sessionId], '/account/sessions/{sessionId}'); - $params = []; + $apiParams = []; if (!isset($sessionId)) { throw new AppwriteException('Missing required parameter: "sessionId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -491,14 +491,14 @@ public function updateSession(string $sessionId): array { $apiPath = str_replace(['{sessionId}'], [$sessionId], '/account/sessions/{sessionId}'); - $params = []; + $apiParams = []; if (!isset($sessionId)) { throw new AppwriteException('Missing required parameter: "sessionId"'); } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -518,14 +518,14 @@ public function deleteSession(string $sessionId): string { $apiPath = str_replace(['{sessionId}'], [$sessionId], '/account/sessions/{sessionId}'); - $params = []; + $apiParams = []; if (!isset($sessionId)) { throw new AppwriteException('Missing required parameter: "sessionId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -543,11 +543,11 @@ public function updateStatus(): array { $apiPath = str_replace([], [], '/account/status'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -578,18 +578,18 @@ public function createVerification(string $url): array { $apiPath = str_replace([], [], '/account/verification'); - $params = []; + $apiParams = []; if (!isset($url)) { throw new AppwriteException('Missing required parameter: "url"'); } if (!is_null($url)) { - $params['url'] = $url; + $apiParams['url'] = $url; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -610,7 +610,7 @@ public function updateVerification(string $userId, string $secret): array { $apiPath = str_replace([], [], '/account/verification'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -618,17 +618,17 @@ public function updateVerification(string $userId, string $secret): array throw new AppwriteException('Missing required parameter: "secret"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($secret)) { - $params['secret'] = $secret; + $apiParams['secret'] = $secret; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -649,11 +649,11 @@ public function createPhoneVerification(): array { $apiPath = str_replace([], [], '/account/verification/phone'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -674,7 +674,7 @@ public function updatePhoneVerification(string $userId, string $secret): array { $apiPath = str_replace([], [], '/account/verification/phone'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -682,16 +682,16 @@ public function updatePhoneVerification(string $userId, string $secret): array throw new AppwriteException('Missing required parameter: "secret"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($secret)) { - $params['secret'] = $secret; + $apiParams['secret'] = $secret; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Avatars.php b/src/Appwrite/Services/Avatars.php index 41e7d87..ea00dce 100644 --- a/src/Appwrite/Services/Avatars.php +++ b/src/Appwrite/Services/Avatars.php @@ -39,26 +39,26 @@ public function getBrowser(string $code, int $width = null, int $height = null, { $apiPath = str_replace(['{code}'], [$code], '/avatars/browsers/{code}'); - $params = []; + $apiParams = []; if (!isset($code)) { throw new AppwriteException('Missing required parameter: "code"'); } if (!is_null($width)) { - $params['width'] = $width; + $apiParams['width'] = $width; } if (!is_null($height)) { - $params['height'] = $height; + $apiParams['height'] = $height; } if (!is_null($quality)) { - $params['quality'] = $quality; + $apiParams['quality'] = $quality; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -86,26 +86,26 @@ public function getCreditCard(string $code, int $width = null, int $height = nul { $apiPath = str_replace(['{code}'], [$code], '/avatars/credit-cards/{code}'); - $params = []; + $apiParams = []; if (!isset($code)) { throw new AppwriteException('Missing required parameter: "code"'); } if (!is_null($width)) { - $params['width'] = $width; + $apiParams['width'] = $width; } if (!is_null($height)) { - $params['height'] = $height; + $apiParams['height'] = $height; } if (!is_null($quality)) { - $params['quality'] = $quality; + $apiParams['quality'] = $quality; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -124,18 +124,18 @@ public function getFavicon(string $url): string { $apiPath = str_replace([], [], '/avatars/favicon'); - $params = []; + $apiParams = []; if (!isset($url)) { throw new AppwriteException('Missing required parameter: "url"'); } if (!is_null($url)) { - $params['url'] = $url; + $apiParams['url'] = $url; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -164,26 +164,26 @@ public function getFlag(string $code, int $width = null, int $height = null, int { $apiPath = str_replace(['{code}'], [$code], '/avatars/flags/{code}'); - $params = []; + $apiParams = []; if (!isset($code)) { throw new AppwriteException('Missing required parameter: "code"'); } if (!is_null($width)) { - $params['width'] = $width; + $apiParams['width'] = $width; } if (!is_null($height)) { - $params['height'] = $height; + $apiParams['height'] = $height; } if (!is_null($quality)) { - $params['quality'] = $quality; + $apiParams['quality'] = $quality; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -211,26 +211,26 @@ public function getImage(string $url, int $width = null, int $height = null): st { $apiPath = str_replace([], [], '/avatars/image'); - $params = []; + $apiParams = []; if (!isset($url)) { throw new AppwriteException('Missing required parameter: "url"'); } if (!is_null($url)) { - $params['url'] = $url; + $apiParams['url'] = $url; } if (!is_null($width)) { - $params['width'] = $width; + $apiParams['width'] = $width; } if (!is_null($height)) { - $params['height'] = $height; + $apiParams['height'] = $height; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -265,27 +265,27 @@ public function getInitials(string $name = null, int $width = null, int $height { $apiPath = str_replace([], [], '/avatars/initials'); - $params = []; + $apiParams = []; if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($width)) { - $params['width'] = $width; + $apiParams['width'] = $width; } if (!is_null($height)) { - $params['height'] = $height; + $apiParams['height'] = $height; } if (!is_null($background)) { - $params['background'] = $background; + $apiParams['background'] = $background; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -307,29 +307,29 @@ public function getQR(string $text, int $size = null, int $margin = null, bool $ { $apiPath = str_replace([], [], '/avatars/qr'); - $params = []; + $apiParams = []; if (!isset($text)) { throw new AppwriteException('Missing required parameter: "text"'); } if (!is_null($text)) { - $params['text'] = $text; + $apiParams['text'] = $text; } if (!is_null($size)) { - $params['size'] = $size; + $apiParams['size'] = $size; } if (!is_null($margin)) { - $params['margin'] = $margin; + $apiParams['margin'] = $margin; } if (!is_null($download)) { - $params['download'] = $download; + $apiParams['download'] = $download; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Databases.php b/src/Appwrite/Services/Databases.php index 384dd4f..5b95147 100644 --- a/src/Appwrite/Services/Databases.php +++ b/src/Appwrite/Services/Databases.php @@ -30,19 +30,19 @@ public function list(array $queries = null, string $search = null): array { $apiPath = str_replace([], [], '/databases'); - $params = []; + $apiParams = []; if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -62,7 +62,7 @@ public function create(string $databaseId, string $name, bool $enabled = null): { $apiPath = str_replace([], [], '/databases'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -70,21 +70,21 @@ public function create(string $databaseId, string $name, bool $enabled = null): throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($databaseId)) { - $params['databaseId'] = $databaseId; + $apiParams['databaseId'] = $databaseId; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($enabled)) { - $params['enabled'] = $enabled; + $apiParams['enabled'] = $enabled; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -102,14 +102,14 @@ public function get(string $databaseId): array { $apiPath = str_replace(['{databaseId}'], [$databaseId], '/databases/{databaseId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -128,7 +128,7 @@ public function update(string $databaseId, string $name, bool $enabled = null): { $apiPath = str_replace(['{databaseId}'], [$databaseId], '/databases/{databaseId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -136,17 +136,17 @@ public function update(string $databaseId, string $name, bool $enabled = null): throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($enabled)) { - $params['enabled'] = $enabled; + $apiParams['enabled'] = $enabled; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -164,14 +164,14 @@ public function delete(string $databaseId): string { $apiPath = str_replace(['{databaseId}'], [$databaseId], '/databases/{databaseId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -191,22 +191,22 @@ public function listCollections(string $databaseId, array $queries = null, strin { $apiPath = str_replace(['{databaseId}'], [$databaseId], '/databases/{databaseId}/collections'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -231,7 +231,7 @@ public function createCollection(string $databaseId, string $collectionId, strin { $apiPath = str_replace(['{databaseId}'], [$databaseId], '/databases/{databaseId}/collections'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -242,29 +242,29 @@ public function createCollection(string $databaseId, string $collectionId, strin throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($collectionId)) { - $params['collectionId'] = $collectionId; + $apiParams['collectionId'] = $collectionId; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($permissions)) { - $params['permissions'] = $permissions; + $apiParams['permissions'] = $permissions; } if (!is_null($documentSecurity)) { - $params['documentSecurity'] = $documentSecurity; + $apiParams['documentSecurity'] = $documentSecurity; } if (!is_null($enabled)) { - $params['enabled'] = $enabled; + $apiParams['enabled'] = $enabled; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -283,7 +283,7 @@ public function getCollection(string $databaseId, string $collectionId): array { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -293,7 +293,7 @@ public function getCollection(string $databaseId, string $collectionId): array return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -315,7 +315,7 @@ public function updateCollection(string $databaseId, string $collectionId, strin { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -326,25 +326,25 @@ public function updateCollection(string $databaseId, string $collectionId, strin throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($permissions)) { - $params['permissions'] = $permissions; + $apiParams['permissions'] = $permissions; } if (!is_null($documentSecurity)) { - $params['documentSecurity'] = $documentSecurity; + $apiParams['documentSecurity'] = $documentSecurity; } if (!is_null($enabled)) { - $params['enabled'] = $enabled; + $apiParams['enabled'] = $enabled; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -363,7 +363,7 @@ public function deleteCollection(string $databaseId, string $collectionId): stri { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -373,7 +373,7 @@ public function deleteCollection(string $databaseId, string $collectionId): stri return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -390,7 +390,7 @@ public function listAttributes(string $databaseId, string $collectionId, array $ { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -398,13 +398,13 @@ public function listAttributes(string $databaseId, string $collectionId, array $ throw new AppwriteException('Missing required parameter: "collectionId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -427,7 +427,7 @@ public function createBooleanAttribute(string $databaseId, string $collectionId, { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -441,25 +441,25 @@ public function createBooleanAttribute(string $databaseId, string $collectionId, throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -478,7 +478,7 @@ public function updateBooleanAttribute(string $databaseId, string $collectionId, { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -492,17 +492,17 @@ public function updateBooleanAttribute(string $databaseId, string $collectionId, throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -522,7 +522,7 @@ public function createDatetimeAttribute(string $databaseId, string $collectionId { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -536,25 +536,25 @@ public function createDatetimeAttribute(string $databaseId, string $collectionId throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -573,7 +573,7 @@ public function updateDatetimeAttribute(string $databaseId, string $collectionId { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -587,17 +587,17 @@ public function updateDatetimeAttribute(string $databaseId, string $collectionId throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -620,7 +620,7 @@ public function createEmailAttribute(string $databaseId, string $collectionId, s { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/email'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -634,25 +634,25 @@ public function createEmailAttribute(string $databaseId, string $collectionId, s throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -675,7 +675,7 @@ public function updateEmailAttribute(string $databaseId, string $collectionId, s { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -689,17 +689,17 @@ public function updateEmailAttribute(string $databaseId, string $collectionId, s throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -720,7 +720,7 @@ public function createEnumAttribute(string $databaseId, string $collectionId, st { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/enum'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -737,29 +737,29 @@ public function createEnumAttribute(string $databaseId, string $collectionId, st throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($elements)) { - $params['elements'] = $elements; + $apiParams['elements'] = $elements; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -783,7 +783,7 @@ public function updateEnumAttribute(string $databaseId, string $collectionId, st { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -800,21 +800,21 @@ public function updateEnumAttribute(string $databaseId, string $collectionId, st throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($elements)) { - $params['elements'] = $elements; + $apiParams['elements'] = $elements; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -840,7 +840,7 @@ public function createFloatAttribute(string $databaseId, string $collectionId, s { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/float'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -854,33 +854,33 @@ public function createFloatAttribute(string $databaseId, string $collectionId, s throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($min)) { - $params['min'] = $min; + $apiParams['min'] = $min; } if (!is_null($max)) { - $params['max'] = $max; + $apiParams['max'] = $max; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -905,7 +905,7 @@ public function updateFloatAttribute(string $databaseId, string $collectionId, s { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -925,25 +925,25 @@ public function updateFloatAttribute(string $databaseId, string $collectionId, s throw new AppwriteException('Missing required parameter: "max"'); } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($min)) { - $params['min'] = $min; + $apiParams['min'] = $min; } if (!is_null($max)) { - $params['max'] = $max; + $apiParams['max'] = $max; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -969,7 +969,7 @@ public function createIntegerAttribute(string $databaseId, string $collectionId, { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/integer'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -983,33 +983,33 @@ public function createIntegerAttribute(string $databaseId, string $collectionId, throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($min)) { - $params['min'] = $min; + $apiParams['min'] = $min; } if (!is_null($max)) { - $params['max'] = $max; + $apiParams['max'] = $max; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1034,7 +1034,7 @@ public function updateIntegerAttribute(string $databaseId, string $collectionId, { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1054,25 +1054,25 @@ public function updateIntegerAttribute(string $databaseId, string $collectionId, throw new AppwriteException('Missing required parameter: "max"'); } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($min)) { - $params['min'] = $min; + $apiParams['min'] = $min; } if (!is_null($max)) { - $params['max'] = $max; + $apiParams['max'] = $max; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1095,7 +1095,7 @@ public function createIpAttribute(string $databaseId, string $collectionId, stri { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/ip'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1109,25 +1109,25 @@ public function createIpAttribute(string $databaseId, string $collectionId, stri throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1150,7 +1150,7 @@ public function updateIpAttribute(string $databaseId, string $collectionId, stri { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1164,17 +1164,17 @@ public function updateIpAttribute(string $databaseId, string $collectionId, stri throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1200,7 +1200,7 @@ public function createRelationshipAttribute(string $databaseId, string $collecti { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1214,33 +1214,33 @@ public function createRelationshipAttribute(string $databaseId, string $collecti throw new AppwriteException('Missing required parameter: "type"'); } if (!is_null($relatedCollectionId)) { - $params['relatedCollectionId'] = $relatedCollectionId; + $apiParams['relatedCollectionId'] = $relatedCollectionId; } if (!is_null($type)) { - $params['type'] = $type; + $apiParams['type'] = $type; } if (!is_null($twoWay)) { - $params['twoWay'] = $twoWay; + $apiParams['twoWay'] = $twoWay; } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($twoWayKey)) { - $params['twoWayKey'] = $twoWayKey; + $apiParams['twoWayKey'] = $twoWayKey; } if (!is_null($onDelete)) { - $params['onDelete'] = $onDelete; + $apiParams['onDelete'] = $onDelete; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1265,7 +1265,7 @@ public function createStringAttribute(string $databaseId, string $collectionId, { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/string'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1282,33 +1282,33 @@ public function createStringAttribute(string $databaseId, string $collectionId, throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($size)) { - $params['size'] = $size; + $apiParams['size'] = $size; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } if (!is_null($encrypt)) { - $params['encrypt'] = $encrypt; + $apiParams['encrypt'] = $encrypt; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1331,7 +1331,7 @@ public function updateStringAttribute(string $databaseId, string $collectionId, { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1345,17 +1345,17 @@ public function updateStringAttribute(string $databaseId, string $collectionId, throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1378,7 +1378,7 @@ public function createUrlAttribute(string $databaseId, string $collectionId, str { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/attributes/url'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1392,25 +1392,25 @@ public function createUrlAttribute(string $databaseId, string $collectionId, str throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } if (!is_null($xarray)) { - $params['array'] = $xarray; + $apiParams['array'] = $xarray; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1433,7 +1433,7 @@ public function updateUrlAttribute(string $databaseId, string $collectionId, str { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1447,17 +1447,17 @@ public function updateUrlAttribute(string $databaseId, string $collectionId, str throw new AppwriteException('Missing required parameter: "required"'); } if (!is_null($required)) { - $params['required'] = $required; + $apiParams['required'] = $required; } if (!is_null($xdefault)) { - $params['default'] = $xdefault; + $apiParams['default'] = $xdefault; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1474,7 +1474,7 @@ public function getAttribute(string $databaseId, string $collectionId, string $k { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1487,7 +1487,7 @@ public function getAttribute(string $databaseId, string $collectionId, string $k return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1504,7 +1504,7 @@ public function deleteAttribute(string $databaseId, string $collectionId, string { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1517,7 +1517,7 @@ public function deleteAttribute(string $databaseId, string $collectionId, string return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1539,7 +1539,7 @@ public function updateRelationshipAttribute(string $databaseId, string $collecti { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1550,13 +1550,13 @@ public function updateRelationshipAttribute(string $databaseId, string $collecti throw new AppwriteException('Missing required parameter: "key"'); } if (!is_null($onDelete)) { - $params['onDelete'] = $onDelete; + $apiParams['onDelete'] = $onDelete; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1576,7 +1576,7 @@ public function listDocuments(string $databaseId, string $collectionId, array $q { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/documents'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1584,13 +1584,13 @@ public function listDocuments(string $databaseId, string $collectionId, array $q throw new AppwriteException('Missing required parameter: "collectionId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1614,7 +1614,7 @@ public function createDocument(string $databaseId, string $collectionId, string { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/documents'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1628,21 +1628,21 @@ public function createDocument(string $databaseId, string $collectionId, string throw new AppwriteException('Missing required parameter: "data"'); } if (!is_null($documentId)) { - $params['documentId'] = $documentId; + $apiParams['documentId'] = $documentId; } if (!is_null($data)) { - $params['data'] = $data; + $apiParams['data'] = $data; } if (!is_null($permissions)) { - $params['permissions'] = $permissions; + $apiParams['permissions'] = $permissions; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1663,7 +1663,7 @@ public function getDocument(string $databaseId, string $collectionId, string $do { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{documentId}'], [$databaseId, $collectionId, $documentId], '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1674,13 +1674,13 @@ public function getDocument(string $databaseId, string $collectionId, string $do throw new AppwriteException('Missing required parameter: "documentId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1702,7 +1702,7 @@ public function updateDocument(string $databaseId, string $collectionId, string { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{documentId}'], [$databaseId, $collectionId, $documentId], '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1713,17 +1713,17 @@ public function updateDocument(string $databaseId, string $collectionId, string throw new AppwriteException('Missing required parameter: "documentId"'); } if (!is_null($data)) { - $params['data'] = $data; + $apiParams['data'] = $data; } if (!is_null($permissions)) { - $params['permissions'] = $permissions; + $apiParams['permissions'] = $permissions; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1742,7 +1742,7 @@ public function deleteDocument(string $databaseId, string $collectionId, string { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{documentId}'], [$databaseId, $collectionId, $documentId], '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1755,7 +1755,7 @@ public function deleteDocument(string $databaseId, string $collectionId, string return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1772,7 +1772,7 @@ public function listIndexes(string $databaseId, string $collectionId, array $que { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/indexes'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1780,13 +1780,13 @@ public function listIndexes(string $databaseId, string $collectionId, array $que throw new AppwriteException('Missing required parameter: "collectionId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1806,7 +1806,7 @@ public function createIndex(string $databaseId, string $collectionId, string $ke { $apiPath = str_replace(['{databaseId}', '{collectionId}'], [$databaseId, $collectionId], '/databases/{databaseId}/collections/{collectionId}/indexes'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1823,25 +1823,25 @@ public function createIndex(string $databaseId, string $collectionId, string $ke throw new AppwriteException('Missing required parameter: "attributes"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($type)) { - $params['type'] = $type; + $apiParams['type'] = $type; } if (!is_null($attributes)) { - $params['attributes'] = $attributes; + $apiParams['attributes'] = $attributes; } if (!is_null($orders)) { - $params['orders'] = $orders; + $apiParams['orders'] = $orders; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1858,7 +1858,7 @@ public function getIndex(string $databaseId, string $collectionId, string $key): { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1871,7 +1871,7 @@ public function getIndex(string $databaseId, string $collectionId, string $key): return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1888,7 +1888,7 @@ public function deleteIndex(string $databaseId, string $collectionId, string $ke { $apiPath = str_replace(['{databaseId}', '{collectionId}', '{key}'], [$databaseId, $collectionId, $key], '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'); - $params = []; + $apiParams = []; if (!isset($databaseId)) { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1901,6 +1901,6 @@ public function deleteIndex(string $databaseId, string $collectionId, string $ke return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Functions.php b/src/Appwrite/Services/Functions.php index 16e7910..cbab3f7 100644 --- a/src/Appwrite/Services/Functions.php +++ b/src/Appwrite/Services/Functions.php @@ -30,19 +30,19 @@ public function list(array $queries = null, string $search = null): array { $apiPath = str_replace([], [], '/functions'); - $params = []; + $apiParams = []; if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -80,7 +80,7 @@ public function create(string $functionId, string $name, string $runtime, array { $apiPath = str_replace([], [], '/functions'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -91,89 +91,89 @@ public function create(string $functionId, string $name, string $runtime, array throw new AppwriteException('Missing required parameter: "runtime"'); } if (!is_null($functionId)) { - $params['functionId'] = $functionId; + $apiParams['functionId'] = $functionId; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($runtime)) { - $params['runtime'] = $runtime; + $apiParams['runtime'] = $runtime; } if (!is_null($execute)) { - $params['execute'] = $execute; + $apiParams['execute'] = $execute; } if (!is_null($events)) { - $params['events'] = $events; + $apiParams['events'] = $events; } if (!is_null($schedule)) { - $params['schedule'] = $schedule; + $apiParams['schedule'] = $schedule; } if (!is_null($timeout)) { - $params['timeout'] = $timeout; + $apiParams['timeout'] = $timeout; } if (!is_null($enabled)) { - $params['enabled'] = $enabled; + $apiParams['enabled'] = $enabled; } if (!is_null($logging)) { - $params['logging'] = $logging; + $apiParams['logging'] = $logging; } if (!is_null($entrypoint)) { - $params['entrypoint'] = $entrypoint; + $apiParams['entrypoint'] = $entrypoint; } if (!is_null($commands)) { - $params['commands'] = $commands; + $apiParams['commands'] = $commands; } if (!is_null($installationId)) { - $params['installationId'] = $installationId; + $apiParams['installationId'] = $installationId; } if (!is_null($providerRepositoryId)) { - $params['providerRepositoryId'] = $providerRepositoryId; + $apiParams['providerRepositoryId'] = $providerRepositoryId; } if (!is_null($providerBranch)) { - $params['providerBranch'] = $providerBranch; + $apiParams['providerBranch'] = $providerBranch; } if (!is_null($providerSilentMode)) { - $params['providerSilentMode'] = $providerSilentMode; + $apiParams['providerSilentMode'] = $providerSilentMode; } if (!is_null($providerRootDirectory)) { - $params['providerRootDirectory'] = $providerRootDirectory; + $apiParams['providerRootDirectory'] = $providerRootDirectory; } if (!is_null($templateRepository)) { - $params['templateRepository'] = $templateRepository; + $apiParams['templateRepository'] = $templateRepository; } if (!is_null($templateOwner)) { - $params['templateOwner'] = $templateOwner; + $apiParams['templateOwner'] = $templateOwner; } if (!is_null($templateRootDirectory)) { - $params['templateRootDirectory'] = $templateRootDirectory; + $apiParams['templateRootDirectory'] = $templateRootDirectory; } if (!is_null($templateBranch)) { - $params['templateBranch'] = $templateBranch; + $apiParams['templateBranch'] = $templateBranch; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -189,11 +189,11 @@ public function listRuntimes(): array { $apiPath = str_replace([], [], '/functions/runtimes'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -210,14 +210,14 @@ public function get(string $functionId): array { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -249,7 +249,7 @@ public function update(string $functionId, string $name, string $runtime, array { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -260,69 +260,69 @@ public function update(string $functionId, string $name, string $runtime, array throw new AppwriteException('Missing required parameter: "runtime"'); } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($runtime)) { - $params['runtime'] = $runtime; + $apiParams['runtime'] = $runtime; } if (!is_null($execute)) { - $params['execute'] = $execute; + $apiParams['execute'] = $execute; } if (!is_null($events)) { - $params['events'] = $events; + $apiParams['events'] = $events; } if (!is_null($schedule)) { - $params['schedule'] = $schedule; + $apiParams['schedule'] = $schedule; } if (!is_null($timeout)) { - $params['timeout'] = $timeout; + $apiParams['timeout'] = $timeout; } if (!is_null($enabled)) { - $params['enabled'] = $enabled; + $apiParams['enabled'] = $enabled; } if (!is_null($logging)) { - $params['logging'] = $logging; + $apiParams['logging'] = $logging; } if (!is_null($entrypoint)) { - $params['entrypoint'] = $entrypoint; + $apiParams['entrypoint'] = $entrypoint; } if (!is_null($commands)) { - $params['commands'] = $commands; + $apiParams['commands'] = $commands; } if (!is_null($installationId)) { - $params['installationId'] = $installationId; + $apiParams['installationId'] = $installationId; } if (!is_null($providerRepositoryId)) { - $params['providerRepositoryId'] = $providerRepositoryId; + $apiParams['providerRepositoryId'] = $providerRepositoryId; } if (!is_null($providerBranch)) { - $params['providerBranch'] = $providerBranch; + $apiParams['providerBranch'] = $providerBranch; } if (!is_null($providerSilentMode)) { - $params['providerSilentMode'] = $providerSilentMode; + $apiParams['providerSilentMode'] = $providerSilentMode; } if (!is_null($providerRootDirectory)) { - $params['providerRootDirectory'] = $providerRootDirectory; + $apiParams['providerRootDirectory'] = $providerRootDirectory; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -339,14 +339,14 @@ public function delete(string $functionId): string { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -366,22 +366,22 @@ public function listDeployments(string $functionId, array $queries = null, strin { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/deployments'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -411,7 +411,7 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/deployments'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -422,19 +422,19 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti throw new AppwriteException('Missing required parameter: "activate"'); } if (!is_null($entrypoint)) { - $params['entrypoint'] = $entrypoint; + $apiParams['entrypoint'] = $entrypoint; } if (!is_null($commands)) { - $params['commands'] = $commands; + $apiParams['commands'] = $commands; } if (!is_null($code)) { - $params['code'] = $code; + $apiParams['code'] = $code; } if (!is_null($activate)) { - $params['activate'] = $activate; + $apiParams['activate'] = $activate; } @@ -446,10 +446,10 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $mimeType = $code->getMimeType(); $postedName = $code->getFilename(); if ($size <= Client::CHUNK_SIZE) { - $params['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($code->getData()), $mimeType, $postedName); + $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($code->getData()), $mimeType, $postedName); return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', - ], $params); + ], $apiParams); } } else { $size = filesize($code->getPath()); @@ -457,10 +457,10 @@ 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) { - $params['code'] = new \CURLFile($code->getPath(), $mimeType, $postedName); + $apiParams['code'] = new \CURLFile($code->getPath(), $mimeType, $postedName); return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', - ], $params); + ], $apiParams); } } @@ -468,7 +468,7 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti $counter = 0; - $headers = ['content-type' => 'multipart/form-data']; + $apiHeaders = ['content-type' => 'multipart/form-data']; $handle = null; if(!empty($code->getPath())) { @@ -484,12 +484,12 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti } else { $chunk = substr($file->getData(), $start, Client::CHUNK_SIZE); } - $params['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); - $headers['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) . '/' . $size; + $apiParams['code'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); + $apiHeaders['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size - 1) . '/' . $size; if(!empty($id)) { - $headers['x-appwrite-id'] = $id; + $apiHeaders['x-appwrite-id'] = $id; } - $response = $this->client->call(Client::METHOD_POST, $apiPath, $headers, $params); + $response = $this->client->call(Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams); $counter++; $start += Client::CHUNK_SIZE; if(empty($id)) { @@ -498,7 +498,7 @@ public function createDeployment(string $functionId, InputFile $code, bool $acti if($onProgress !== null) { $onProgress([ '$id' => $response['$id'], - 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) / $size * 100, + 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE)), $size) / $size * 100, 'sizeUploaded' => min($counter * Client::CHUNK_SIZE), 'chunksTotal' => $response['chunksTotal'], 'chunksUploaded' => $response['chunksUploaded'], @@ -527,7 +527,7 @@ public function getDeployment(string $functionId, string $deploymentId): array { $apiPath = str_replace(['{functionId}', '{deploymentId}'], [$functionId, $deploymentId], '/functions/{functionId}/deployments/{deploymentId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -537,7 +537,7 @@ public function getDeployment(string $functionId, string $deploymentId): array return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -557,7 +557,7 @@ public function updateDeployment(string $functionId, string $deploymentId): arra { $apiPath = str_replace(['{functionId}', '{deploymentId}'], [$functionId, $deploymentId], '/functions/{functionId}/deployments/{deploymentId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -567,7 +567,7 @@ public function updateDeployment(string $functionId, string $deploymentId): arra return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -585,7 +585,7 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri { $apiPath = str_replace(['{functionId}', '{deploymentId}'], [$functionId, $deploymentId], '/functions/{functionId}/deployments/{deploymentId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -595,7 +595,7 @@ public function deleteDeployment(string $functionId, string $deploymentId): stri return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -615,7 +615,7 @@ public function createBuild(string $functionId, string $deploymentId, string $bu { $apiPath = str_replace(['{functionId}', '{deploymentId}', '{buildId}'], [$functionId, $deploymentId, $buildId], '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -628,7 +628,7 @@ public function createBuild(string $functionId, string $deploymentId, string $bu return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -644,7 +644,7 @@ public function downloadDeployment(string $functionId, string $deploymentId): st { $apiPath = str_replace(['{functionId}', '{deploymentId}'], [$functionId, $deploymentId], '/functions/{functionId}/deployments/{deploymentId}/download'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -654,7 +654,7 @@ public function downloadDeployment(string $functionId, string $deploymentId): st return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -674,22 +674,22 @@ public function listExecutions(string $functionId, array $queries = null, string { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/executions'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -714,34 +714,34 @@ public function createExecution(string $functionId, string $body = null, bool $a { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/executions'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } if (!is_null($body)) { - $params['body'] = $body; + $apiParams['body'] = $body; } if (!is_null($async)) { - $params['async'] = $async; + $apiParams['async'] = $async; } if (!is_null($xpath)) { - $params['path'] = $xpath; + $apiParams['path'] = $xpath; } if (!is_null($method)) { - $params['method'] = $method; + $apiParams['method'] = $method; } if (!is_null($headers)) { - $params['headers'] = $headers; + $apiParams['headers'] = $headers; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -759,7 +759,7 @@ public function getExecution(string $functionId, string $executionId): array { $apiPath = str_replace(['{functionId}', '{executionId}'], [$functionId, $executionId], '/functions/{functionId}/executions/{executionId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -769,7 +769,7 @@ public function getExecution(string $functionId, string $executionId): array return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -786,14 +786,14 @@ public function listVariables(string $functionId): array { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/variables'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -813,7 +813,7 @@ public function createVariable(string $functionId, string $key, string $value): { $apiPath = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/variables'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -824,17 +824,17 @@ public function createVariable(string $functionId, string $key, string $value): throw new AppwriteException('Missing required parameter: "value"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($value)) { - $params['value'] = $value; + $apiParams['value'] = $value; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -852,7 +852,7 @@ public function getVariable(string $functionId, string $variableId): array { $apiPath = str_replace(['{functionId}', '{variableId}'], [$functionId, $variableId], '/functions/{functionId}/variables/{variableId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -862,7 +862,7 @@ public function getVariable(string $functionId, string $variableId): array return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -882,7 +882,7 @@ public function updateVariable(string $functionId, string $variableId, string $k { $apiPath = str_replace(['{functionId}', '{variableId}'], [$functionId, $variableId], '/functions/{functionId}/variables/{variableId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -893,17 +893,17 @@ public function updateVariable(string $functionId, string $variableId, string $k throw new AppwriteException('Missing required parameter: "key"'); } if (!is_null($key)) { - $params['key'] = $key; + $apiParams['key'] = $key; } if (!is_null($value)) { - $params['value'] = $value; + $apiParams['value'] = $value; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -921,7 +921,7 @@ public function deleteVariable(string $functionId, string $variableId): string { $apiPath = str_replace(['{functionId}', '{variableId}'], [$functionId, $variableId], '/functions/{functionId}/variables/{variableId}'); - $params = []; + $apiParams = []; if (!isset($functionId)) { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -931,6 +931,6 @@ public function deleteVariable(string $functionId, string $variableId): string return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Graphql.php b/src/Appwrite/Services/Graphql.php index e7aa409..397a0ee 100644 --- a/src/Appwrite/Services/Graphql.php +++ b/src/Appwrite/Services/Graphql.php @@ -28,19 +28,19 @@ public function query(array $query): array { $apiPath = str_replace([], [], '/graphql'); - $params = []; + $apiParams = []; if (!isset($query)) { throw new AppwriteException('Missing required parameter: "query"'); } if (!is_null($query)) { - $params['query'] = $query; + $apiParams['query'] = $query; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'x-sdk-graphql' => 'true', 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -57,18 +57,18 @@ public function mutation(array $query): array { $apiPath = str_replace([], [], '/graphql/mutation'); - $params = []; + $apiParams = []; if (!isset($query)) { throw new AppwriteException('Missing required parameter: "query"'); } if (!is_null($query)) { - $params['query'] = $query; + $apiParams['query'] = $query; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'x-sdk-graphql' => 'true', 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Health.php b/src/Appwrite/Services/Health.php index fe2ffa8..9955b0d 100644 --- a/src/Appwrite/Services/Health.php +++ b/src/Appwrite/Services/Health.php @@ -27,11 +27,11 @@ public function get(): array { $apiPath = str_replace([], [], '/health'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -47,11 +47,11 @@ public function getAntivirus(): array { $apiPath = str_replace([], [], '/health/anti-virus'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -68,11 +68,11 @@ public function getCache(): array { $apiPath = str_replace([], [], '/health/cache'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -88,11 +88,11 @@ public function getDB(): array { $apiPath = str_replace([], [], '/health/db'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -108,11 +108,11 @@ public function getPubSub(): array { $apiPath = str_replace([], [], '/health/pubsub'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -129,11 +129,11 @@ public function getQueue(): array { $apiPath = str_replace([], [], '/health/queue'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -151,11 +151,11 @@ public function getQueueCertificates(): array { $apiPath = str_replace([], [], '/health/queue/certificates'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -169,11 +169,11 @@ public function getQueueFunctions(): array { $apiPath = str_replace([], [], '/health/queue/functions'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -190,11 +190,11 @@ public function getQueueLogs(): array { $apiPath = str_replace([], [], '/health/queue/logs'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -211,11 +211,11 @@ public function getQueueWebhooks(): array { $apiPath = str_replace([], [], '/health/queue/webhooks'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -231,11 +231,11 @@ public function getStorageLocal(): array { $apiPath = str_replace([], [], '/health/storage/local'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -257,10 +257,10 @@ public function getTime(): array { $apiPath = str_replace([], [], '/health/time'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Locale.php b/src/Appwrite/Services/Locale.php index 648ebc1..eb5d231 100644 --- a/src/Appwrite/Services/Locale.php +++ b/src/Appwrite/Services/Locale.php @@ -32,11 +32,11 @@ public function get(): array { $apiPath = str_replace([], [], '/locale'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -53,11 +53,11 @@ public function listCodes(): array { $apiPath = str_replace([], [], '/locale/codes'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -74,11 +74,11 @@ public function listContinents(): array { $apiPath = str_replace([], [], '/locale/continents'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -95,11 +95,11 @@ public function listCountries(): array { $apiPath = str_replace([], [], '/locale/countries'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -116,11 +116,11 @@ public function listCountriesEU(): array { $apiPath = str_replace([], [], '/locale/countries/eu'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -137,11 +137,11 @@ public function listCountriesPhones(): array { $apiPath = str_replace([], [], '/locale/countries/phones'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -159,11 +159,11 @@ public function listCurrencies(): array { $apiPath = str_replace([], [], '/locale/currencies'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -180,10 +180,10 @@ public function listLanguages(): array { $apiPath = str_replace([], [], '/locale/languages'); - $params = []; + $apiParams = []; return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Storage.php b/src/Appwrite/Services/Storage.php index 2280b48..e1728cc 100644 --- a/src/Appwrite/Services/Storage.php +++ b/src/Appwrite/Services/Storage.php @@ -30,19 +30,19 @@ public function listBuckets(array $queries = null, string $search = null): array { $apiPath = str_replace([], [], '/storage/buckets'); - $params = []; + $apiParams = []; if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -68,7 +68,7 @@ public function createBucket(string $bucketId, string $name, array $permissions { $apiPath = str_replace([], [], '/storage/buckets'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -76,49 +76,49 @@ public function createBucket(string $bucketId, string $name, array $permissions throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($bucketId)) { - $params['bucketId'] = $bucketId; + $apiParams['bucketId'] = $bucketId; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($permissions)) { - $params['permissions'] = $permissions; + $apiParams['permissions'] = $permissions; } if (!is_null($fileSecurity)) { - $params['fileSecurity'] = $fileSecurity; + $apiParams['fileSecurity'] = $fileSecurity; } if (!is_null($enabled)) { - $params['enabled'] = $enabled; + $apiParams['enabled'] = $enabled; } if (!is_null($maximumFileSize)) { - $params['maximumFileSize'] = $maximumFileSize; + $apiParams['maximumFileSize'] = $maximumFileSize; } if (!is_null($allowedFileExtensions)) { - $params['allowedFileExtensions'] = $allowedFileExtensions; + $apiParams['allowedFileExtensions'] = $allowedFileExtensions; } if (!is_null($compression)) { - $params['compression'] = $compression; + $apiParams['compression'] = $compression; } if (!is_null($encryption)) { - $params['encryption'] = $encryption; + $apiParams['encryption'] = $encryption; } if (!is_null($antivirus)) { - $params['antivirus'] = $antivirus; + $apiParams['antivirus'] = $antivirus; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -136,14 +136,14 @@ public function getBucket(string $bucketId): array { $apiPath = str_replace(['{bucketId}'], [$bucketId], '/storage/buckets/{bucketId}'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -169,7 +169,7 @@ public function updateBucket(string $bucketId, string $name, array $permissions { $apiPath = str_replace(['{bucketId}'], [$bucketId], '/storage/buckets/{bucketId}'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -177,45 +177,45 @@ public function updateBucket(string $bucketId, string $name, array $permissions throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($permissions)) { - $params['permissions'] = $permissions; + $apiParams['permissions'] = $permissions; } if (!is_null($fileSecurity)) { - $params['fileSecurity'] = $fileSecurity; + $apiParams['fileSecurity'] = $fileSecurity; } if (!is_null($enabled)) { - $params['enabled'] = $enabled; + $apiParams['enabled'] = $enabled; } if (!is_null($maximumFileSize)) { - $params['maximumFileSize'] = $maximumFileSize; + $apiParams['maximumFileSize'] = $maximumFileSize; } if (!is_null($allowedFileExtensions)) { - $params['allowedFileExtensions'] = $allowedFileExtensions; + $apiParams['allowedFileExtensions'] = $allowedFileExtensions; } if (!is_null($compression)) { - $params['compression'] = $compression; + $apiParams['compression'] = $compression; } if (!is_null($encryption)) { - $params['encryption'] = $encryption; + $apiParams['encryption'] = $encryption; } if (!is_null($antivirus)) { - $params['antivirus'] = $antivirus; + $apiParams['antivirus'] = $antivirus; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -232,14 +232,14 @@ public function deleteBucket(string $bucketId): string { $apiPath = str_replace(['{bucketId}'], [$bucketId], '/storage/buckets/{bucketId}'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -259,22 +259,22 @@ public function listFiles(string $bucketId, array $queries = null, string $searc { $apiPath = str_replace(['{bucketId}'], [$bucketId], '/storage/buckets/{bucketId}/files'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -311,7 +311,7 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ar { $apiPath = str_replace(['{bucketId}'], [$bucketId], '/storage/buckets/{bucketId}/files'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -322,15 +322,15 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ar throw new AppwriteException('Missing required parameter: "file"'); } if (!is_null($fileId)) { - $params['fileId'] = $fileId; + $apiParams['fileId'] = $fileId; } if (!is_null($file)) { - $params['file'] = $file; + $apiParams['file'] = $file; } if (!is_null($permissions)) { - $params['permissions'] = $permissions; + $apiParams['permissions'] = $permissions; } @@ -342,10 +342,10 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ar $mimeType = $file->getMimeType(); $postedName = $file->getFilename(); if ($size <= Client::CHUNK_SIZE) { - $params['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($file->getData()), $mimeType, $postedName); + $apiParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($file->getData()), $mimeType, $postedName); return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', - ], $params); + ], $apiParams); } } else { $size = filesize($file->getPath()); @@ -353,10 +353,10 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ar $postedName = $file->getFilename() ?? basename($file->getPath()); //send single file if size is less than or equal to 5MB if ($size <= Client::CHUNK_SIZE) { - $params['file'] = new \CURLFile($file->getPath(), $mimeType, $postedName); + $apiParams['file'] = new \CURLFile($file->getPath(), $mimeType, $postedName); return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'multipart/form-data', - ], $params); + ], $apiParams); } } @@ -371,7 +371,7 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ar } } - $headers = ['content-type' => 'multipart/form-data']; + $apiHeaders = ['content-type' => 'multipart/form-data']; $handle = null; if(!empty($file->getPath())) { @@ -387,12 +387,12 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ar } else { $chunk = substr($file->getData(), $start, Client::CHUNK_SIZE); } - $params['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); - $headers['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) . '/' . $size; + $apiParams['file'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); + $apiHeaders['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size - 1) . '/' . $size; if(!empty($id)) { - $headers['x-appwrite-id'] = $id; + $apiHeaders['x-appwrite-id'] = $id; } - $response = $this->client->call(Client::METHOD_POST, $apiPath, $headers, $params); + $response = $this->client->call(Client::METHOD_POST, $apiPath, $apiHeaders, $apiParams); $counter++; $start += Client::CHUNK_SIZE; if(empty($id)) { @@ -401,7 +401,7 @@ public function createFile(string $bucketId, string $fileId, InputFile $file, ar if($onProgress !== null) { $onProgress([ '$id' => $response['$id'], - 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) / $size * 100, + 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE)), $size) / $size * 100, 'sizeUploaded' => min($counter * Client::CHUNK_SIZE), 'chunksTotal' => $response['chunksTotal'], 'chunksUploaded' => $response['chunksUploaded'], @@ -431,7 +431,7 @@ public function getFile(string $bucketId, string $fileId): array { $apiPath = str_replace(['{bucketId}', '{fileId}'], [$bucketId, $fileId], '/storage/buckets/{bucketId}/files/{fileId}'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -441,7 +441,7 @@ public function getFile(string $bucketId, string $fileId): array return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -462,7 +462,7 @@ public function updateFile(string $bucketId, string $fileId, string $name = null { $apiPath = str_replace(['{bucketId}', '{fileId}'], [$bucketId, $fileId], '/storage/buckets/{bucketId}/files/{fileId}'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -470,17 +470,17 @@ public function updateFile(string $bucketId, string $fileId, string $name = null throw new AppwriteException('Missing required parameter: "fileId"'); } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($permissions)) { - $params['permissions'] = $permissions; + $apiParams['permissions'] = $permissions; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -499,7 +499,7 @@ public function deleteFile(string $bucketId, string $fileId): string { $apiPath = str_replace(['{bucketId}', '{fileId}'], [$bucketId, $fileId], '/storage/buckets/{bucketId}/files/{fileId}'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -509,7 +509,7 @@ public function deleteFile(string $bucketId, string $fileId): string return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -529,7 +529,7 @@ public function getFileDownload(string $bucketId, string $fileId): string { $apiPath = str_replace(['{bucketId}', '{fileId}'], [$bucketId, $fileId], '/storage/buckets/{bucketId}/files/{fileId}/download'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -539,7 +539,7 @@ public function getFileDownload(string $bucketId, string $fileId): string return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -572,7 +572,7 @@ public function getFilePreview(string $bucketId, string $fileId, int $width = nu { $apiPath = str_replace(['{bucketId}', '{fileId}'], [$bucketId, $fileId], '/storage/buckets/{bucketId}/files/{fileId}/preview'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -580,53 +580,53 @@ public function getFilePreview(string $bucketId, string $fileId, int $width = nu throw new AppwriteException('Missing required parameter: "fileId"'); } if (!is_null($width)) { - $params['width'] = $width; + $apiParams['width'] = $width; } if (!is_null($height)) { - $params['height'] = $height; + $apiParams['height'] = $height; } if (!is_null($gravity)) { - $params['gravity'] = $gravity; + $apiParams['gravity'] = $gravity; } if (!is_null($quality)) { - $params['quality'] = $quality; + $apiParams['quality'] = $quality; } if (!is_null($borderWidth)) { - $params['borderWidth'] = $borderWidth; + $apiParams['borderWidth'] = $borderWidth; } if (!is_null($borderColor)) { - $params['borderColor'] = $borderColor; + $apiParams['borderColor'] = $borderColor; } if (!is_null($borderRadius)) { - $params['borderRadius'] = $borderRadius; + $apiParams['borderRadius'] = $borderRadius; } if (!is_null($opacity)) { - $params['opacity'] = $opacity; + $apiParams['opacity'] = $opacity; } if (!is_null($rotation)) { - $params['rotation'] = $rotation; + $apiParams['rotation'] = $rotation; } if (!is_null($background)) { - $params['background'] = $background; + $apiParams['background'] = $background; } if (!is_null($output)) { - $params['output'] = $output; + $apiParams['output'] = $output; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -646,7 +646,7 @@ public function getFileView(string $bucketId, string $fileId): string { $apiPath = str_replace(['{bucketId}', '{fileId}'], [$bucketId, $fileId], '/storage/buckets/{bucketId}/files/{fileId}/view'); - $params = []; + $apiParams = []; if (!isset($bucketId)) { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -656,6 +656,6 @@ public function getFileView(string $bucketId, string $fileId): string return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Teams.php b/src/Appwrite/Services/Teams.php index b335d98..3c046d0 100644 --- a/src/Appwrite/Services/Teams.php +++ b/src/Appwrite/Services/Teams.php @@ -30,19 +30,19 @@ public function list(array $queries = null, string $search = null): array { $apiPath = str_replace([], [], '/teams'); - $params = []; + $apiParams = []; if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -63,7 +63,7 @@ public function create(string $teamId, string $name, array $roles = null): array { $apiPath = str_replace([], [], '/teams'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -71,21 +71,21 @@ public function create(string $teamId, string $name, array $roles = null): array throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($teamId)) { - $params['teamId'] = $teamId; + $apiParams['teamId'] = $teamId; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } if (!is_null($roles)) { - $params['roles'] = $roles; + $apiParams['roles'] = $roles; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -102,14 +102,14 @@ public function get(string $teamId): array { $apiPath = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -127,7 +127,7 @@ public function updateName(string $teamId, string $name): array { $apiPath = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -135,13 +135,13 @@ public function updateName(string $teamId, string $name): array throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -159,14 +159,14 @@ public function delete(string $teamId): string { $apiPath = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -186,22 +186,22 @@ public function listMemberships(string $teamId, array $queries = null, string $s { $apiPath = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/memberships'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -244,7 +244,7 @@ public function createMembership(string $teamId, array $roles, string $url, stri { $apiPath = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/memberships'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -255,33 +255,33 @@ public function createMembership(string $teamId, array $roles, string $url, stri throw new AppwriteException('Missing required parameter: "url"'); } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($phone)) { - $params['phone'] = $phone; + $apiParams['phone'] = $phone; } if (!is_null($roles)) { - $params['roles'] = $roles; + $apiParams['roles'] = $roles; } if (!is_null($url)) { - $params['url'] = $url; + $apiParams['url'] = $url; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -300,7 +300,7 @@ public function getMembership(string $teamId, string $membershipId): array { $apiPath = str_replace(['{teamId}', '{membershipId}'], [$teamId, $membershipId], '/teams/{teamId}/memberships/{membershipId}'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -310,7 +310,7 @@ public function getMembership(string $teamId, string $membershipId): array return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -332,7 +332,7 @@ public function updateMembership(string $teamId, string $membershipId, array $ro { $apiPath = str_replace(['{teamId}', '{membershipId}'], [$teamId, $membershipId], '/teams/{teamId}/memberships/{membershipId}'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -343,13 +343,13 @@ public function updateMembership(string $teamId, string $membershipId, array $ro throw new AppwriteException('Missing required parameter: "roles"'); } if (!is_null($roles)) { - $params['roles'] = $roles; + $apiParams['roles'] = $roles; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -369,7 +369,7 @@ public function deleteMembership(string $teamId, string $membershipId): string { $apiPath = str_replace(['{teamId}', '{membershipId}'], [$teamId, $membershipId], '/teams/{teamId}/memberships/{membershipId}'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -379,7 +379,7 @@ public function deleteMembership(string $teamId, string $membershipId): string return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -405,7 +405,7 @@ public function updateMembershipStatus(string $teamId, string $membershipId, str { $apiPath = str_replace(['{teamId}', '{membershipId}'], [$teamId, $membershipId], '/teams/{teamId}/memberships/{membershipId}/status'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -419,17 +419,17 @@ public function updateMembershipStatus(string $teamId, string $membershipId, str throw new AppwriteException('Missing required parameter: "secret"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($secret)) { - $params['secret'] = $secret; + $apiParams['secret'] = $secret; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -448,14 +448,14 @@ public function getPrefs(string $teamId): array { $apiPath = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/prefs'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -475,7 +475,7 @@ public function updatePrefs(string $teamId, array $prefs): array { $apiPath = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/prefs'); - $params = []; + $apiParams = []; if (!isset($teamId)) { throw new AppwriteException('Missing required parameter: "teamId"'); } @@ -483,12 +483,12 @@ public function updatePrefs(string $teamId, array $prefs): array throw new AppwriteException('Missing required parameter: "prefs"'); } if (!is_null($prefs)) { - $params['prefs'] = $prefs; + $apiParams['prefs'] = $prefs; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } } diff --git a/src/Appwrite/Services/Users.php b/src/Appwrite/Services/Users.php index 9d4b943..fcf03dd 100644 --- a/src/Appwrite/Services/Users.php +++ b/src/Appwrite/Services/Users.php @@ -30,19 +30,19 @@ public function list(array $queries = null, string $search = null): array { $apiPath = str_replace([], [], '/users'); - $params = []; + $apiParams = []; if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -63,34 +63,34 @@ public function create(string $userId, string $email = null, string $phone = nul { $apiPath = str_replace([], [], '/users'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($phone)) { - $params['phone'] = $phone; + $apiParams['phone'] = $phone; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -113,7 +113,7 @@ public function createArgon2User(string $userId, string $email, string $password { $apiPath = str_replace([], [], '/users/argon2'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -124,25 +124,25 @@ public function createArgon2User(string $userId, string $email, string $password throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -165,7 +165,7 @@ public function createBcryptUser(string $userId, string $email, string $password { $apiPath = str_replace([], [], '/users/bcrypt'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -176,25 +176,25 @@ public function createBcryptUser(string $userId, string $email, string $password throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -212,19 +212,19 @@ public function listIdentities(string $queries = null, string $search = null): a { $apiPath = str_replace([], [], '/users/identities'); - $params = []; + $apiParams = []; if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } if (!is_null($search)) { - $params['search'] = $search; + $apiParams['search'] = $search; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -241,14 +241,14 @@ public function deleteIdentity(string $identityId): string { $apiPath = str_replace(['{identityId}'], [$identityId], '/users/identities/{identityId}'); - $params = []; + $apiParams = []; if (!isset($identityId)) { throw new AppwriteException('Missing required parameter: "identityId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -271,7 +271,7 @@ public function createMD5User(string $userId, string $email, string $password, s { $apiPath = str_replace([], [], '/users/md5'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -282,25 +282,25 @@ public function createMD5User(string $userId, string $email, string $password, s throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -323,7 +323,7 @@ public function createPHPassUser(string $userId, string $email, string $password { $apiPath = str_replace([], [], '/users/phpass'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -334,25 +334,25 @@ public function createPHPassUser(string $userId, string $email, string $password throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -380,7 +380,7 @@ public function createScryptUser(string $userId, string $email, string $password { $apiPath = str_replace([], [], '/users/scrypt'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -406,45 +406,45 @@ public function createScryptUser(string $userId, string $email, string $password throw new AppwriteException('Missing required parameter: "passwordLength"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($passwordSalt)) { - $params['passwordSalt'] = $passwordSalt; + $apiParams['passwordSalt'] = $passwordSalt; } if (!is_null($passwordCpu)) { - $params['passwordCpu'] = $passwordCpu; + $apiParams['passwordCpu'] = $passwordCpu; } if (!is_null($passwordMemory)) { - $params['passwordMemory'] = $passwordMemory; + $apiParams['passwordMemory'] = $passwordMemory; } if (!is_null($passwordParallel)) { - $params['passwordParallel'] = $passwordParallel; + $apiParams['passwordParallel'] = $passwordParallel; } if (!is_null($passwordLength)) { - $params['passwordLength'] = $passwordLength; + $apiParams['passwordLength'] = $passwordLength; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -470,7 +470,7 @@ public function createScryptModifiedUser(string $userId, string $email, string $ { $apiPath = str_replace([], [], '/users/scrypt-modified'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -490,37 +490,37 @@ public function createScryptModifiedUser(string $userId, string $email, string $ throw new AppwriteException('Missing required parameter: "passwordSignerKey"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($passwordSalt)) { - $params['passwordSalt'] = $passwordSalt; + $apiParams['passwordSalt'] = $passwordSalt; } if (!is_null($passwordSaltSeparator)) { - $params['passwordSaltSeparator'] = $passwordSaltSeparator; + $apiParams['passwordSaltSeparator'] = $passwordSaltSeparator; } if (!is_null($passwordSignerKey)) { - $params['passwordSignerKey'] = $passwordSignerKey; + $apiParams['passwordSignerKey'] = $passwordSignerKey; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -544,7 +544,7 @@ public function createSHAUser(string $userId, string $email, string $password, s { $apiPath = str_replace([], [], '/users/sha'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -555,29 +555,29 @@ public function createSHAUser(string $userId, string $email, string $password, s throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($userId)) { - $params['userId'] = $userId; + $apiParams['userId'] = $userId; } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } if (!is_null($passwordVersion)) { - $params['passwordVersion'] = $passwordVersion; + $apiParams['passwordVersion'] = $passwordVersion; } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_POST, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -594,14 +594,14 @@ public function get(string $userId): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -622,14 +622,14 @@ public function delete(string $userId): string { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -647,7 +647,7 @@ public function updateEmail(string $userId, string $email): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/email'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -655,13 +655,13 @@ public function updateEmail(string $userId, string $email): array throw new AppwriteException('Missing required parameter: "email"'); } if (!is_null($email)) { - $params['email'] = $email; + $apiParams['email'] = $email; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -684,7 +684,7 @@ public function updateLabels(string $userId, array $labels): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/labels'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -692,13 +692,13 @@ public function updateLabels(string $userId, array $labels): array throw new AppwriteException('Missing required parameter: "labels"'); } if (!is_null($labels)) { - $params['labels'] = $labels; + $apiParams['labels'] = $labels; } return $this->client->call(Client::METHOD_PUT, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -716,18 +716,18 @@ public function listLogs(string $userId, array $queries = null): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/logs'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } if (!is_null($queries)) { - $params['queries'] = $queries; + $apiParams['queries'] = $queries; } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -744,14 +744,14 @@ public function listMemberships(string $userId): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/memberships'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -769,7 +769,7 @@ public function updateName(string $userId, string $name): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/name'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -777,13 +777,13 @@ public function updateName(string $userId, string $name): array throw new AppwriteException('Missing required parameter: "name"'); } if (!is_null($name)) { - $params['name'] = $name; + $apiParams['name'] = $name; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -801,7 +801,7 @@ public function updatePassword(string $userId, string $password): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/password'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -809,13 +809,13 @@ public function updatePassword(string $userId, string $password): array throw new AppwriteException('Missing required parameter: "password"'); } if (!is_null($password)) { - $params['password'] = $password; + $apiParams['password'] = $password; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -833,7 +833,7 @@ public function updatePhone(string $userId, string $number): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/phone'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -841,13 +841,13 @@ public function updatePhone(string $userId, string $number): array throw new AppwriteException('Missing required parameter: "number"'); } if (!is_null($number)) { - $params['number'] = $number; + $apiParams['number'] = $number; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -864,14 +864,14 @@ public function getPrefs(string $userId): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/prefs'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -891,7 +891,7 @@ public function updatePrefs(string $userId, array $prefs): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/prefs'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -899,13 +899,13 @@ public function updatePrefs(string $userId, array $prefs): array throw new AppwriteException('Missing required parameter: "prefs"'); } if (!is_null($prefs)) { - $params['prefs'] = $prefs; + $apiParams['prefs'] = $prefs; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -922,14 +922,14 @@ public function listSessions(string $userId): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/sessions'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } return $this->client->call(Client::METHOD_GET, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -946,14 +946,14 @@ public function deleteSessions(string $userId): string { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/sessions'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -971,7 +971,7 @@ public function deleteSession(string $userId, string $sessionId): string { $apiPath = str_replace(['{userId}', '{sessionId}'], [$userId, $sessionId], '/users/{userId}/sessions/{sessionId}'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -981,7 +981,7 @@ public function deleteSession(string $userId, string $sessionId): string return $this->client->call(Client::METHOD_DELETE, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1000,7 +1000,7 @@ public function updateStatus(string $userId, bool $status): array { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/status'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -1008,13 +1008,13 @@ public function updateStatus(string $userId, bool $status): array throw new AppwriteException('Missing required parameter: "status"'); } if (!is_null($status)) { - $params['status'] = $status; + $apiParams['status'] = $status; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1032,7 +1032,7 @@ public function updateEmailVerification(string $userId, bool $emailVerification) { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/verification'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -1040,13 +1040,13 @@ public function updateEmailVerification(string $userId, bool $emailVerification) throw new AppwriteException('Missing required parameter: "emailVerification"'); } if (!is_null($emailVerification)) { - $params['emailVerification'] = $emailVerification; + $apiParams['emailVerification'] = $emailVerification; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } /** @@ -1064,7 +1064,7 @@ public function updatePhoneVerification(string $userId, bool $phoneVerification) { $apiPath = str_replace(['{userId}'], [$userId], '/users/{userId}/verification/phone'); - $params = []; + $apiParams = []; if (!isset($userId)) { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -1072,12 +1072,12 @@ public function updatePhoneVerification(string $userId, bool $phoneVerification) throw new AppwriteException('Missing required parameter: "phoneVerification"'); } if (!is_null($phoneVerification)) { - $params['phoneVerification'] = $phoneVerification; + $apiParams['phoneVerification'] = $phoneVerification; } return $this->client->call(Client::METHOD_PATCH, $apiPath, [ 'content-type' => 'application/json', - ], $params); + ], $apiParams); } }