From 546d8ba5834d8f12e01c60dd9e43b1380b29886d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 31 Oct 2022 07:31:31 +0000 Subject: [PATCH 01/76] refactor to use db pools --- app/tasks/usage.php | 9 +++-- src/Appwrite/Usage/Calculators/TimeSeries.php | 34 +++++++++++++++---- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/app/tasks/usage.php b/app/tasks/usage.php index 68543d0748..c9596e6c65 100644 --- a/app/tasks/usage.php +++ b/app/tasks/usage.php @@ -3,13 +3,11 @@ global $cli, $register; use Appwrite\Usage\Calculators\TimeSeries; -use InfluxDB\Database as InfluxDatabase; use Utopia\App; use Utopia\CLI\Console; -use Utopia\Database\Database as UtopiaDatabase; +use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; use Utopia\Logger\Log; -use Utopia\Validator\WhiteList; Authorization::disable(); Authorization::setDefaultStatus(false); @@ -51,15 +49,16 @@ $logError = function (Throwable $error, string $action = 'syncUsageStats') use ( $cli ->task('usage') ->desc('Schedules syncing data from influxdb to Appwrite console db') - ->action(function () use ($logError) { + ->action(function () use ($register, $logError) { Console::title('Usage Aggregation V1'); Console::success(APP_NAME . ' usage aggregation process v1 has started'); $database = getConsoleDB(); $influxDB = getInfluxDB(); + $getProjectDB = fn (Document $project) => getProjectDB($project); $interval = (int) App::getEnv('_APP_USAGE_AGGREGATION_INTERVAL', '30'); // 30 seconds (by default) - $usage = new TimeSeries($database, $influxDB, $logError); + $usage = new TimeSeries($database, $influxDB, $getProjectDB, $register, $logError); Console::loop(function () use ($interval, $usage) { $now = date('d-m-Y H:i:s', time()); diff --git a/src/Appwrite/Usage/Calculators/TimeSeries.php b/src/Appwrite/Usage/Calculators/TimeSeries.php index 20308684de..6098f55509 100644 --- a/src/Appwrite/Usage/Calculators/TimeSeries.php +++ b/src/Appwrite/Usage/Calculators/TimeSeries.php @@ -7,6 +7,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use InfluxDB\Database as InfluxDatabase; use DateTime; +use Utopia\Registry\Registry; class TimeSeries extends Calculator { @@ -31,6 +32,20 @@ class TimeSeries extends Calculator */ protected $errorHandler; + /** + * Callback to get project DB + * + * @var callable + */ + protected mixed $getProjectDB; + + /** + * Registry + * + * @var Registry + */ + protected Registry $register; + /** * Latest times for metric that was synced to the database * @@ -381,10 +396,12 @@ class TimeSeries extends Calculator ] ]; - public function __construct(Database $database, InfluxDatabase $influxDB, callable $errorHandler = null) + public function __construct(Database $database, InfluxDatabase $influxDB, callable $getProjectDB, Registry $register, callable $errorHandler = null) { $this->database = $database; $this->influxDB = $influxDB; + $this->getProjectDB = $getProjectDB; + $this->register = $register; $this->errorHandler = $errorHandler; } @@ -404,12 +421,13 @@ class TimeSeries extends Calculator private function createOrUpdateMetric(string $projectId, string $time, string $period, string $metric, int $value, int $type): void { $id = \md5("{$time}_{$period}_{$metric}"); - $this->database->setNamespace('_' . $projectId); + $project = $this->database->getDocument('projects', $projectId); + $database = call_user_func($this->getProjectDB, $project); try { - $document = $this->database->getDocument('stats', $id); + $document = $database->getDocument('stats', $id); if ($document->isEmpty()) { - $this->database->createDocument('stats', new Document([ + $database->createDocument('stats', new Document([ '$id' => $id, 'period' => $period, 'time' => $time, @@ -418,7 +436,7 @@ class TimeSeries extends Calculator 'type' => $type, ])); } else { - $this->database->updateDocument( + $database->updateDocument( 'stats', $document->getId(), $document->setAttribute('value', $value) @@ -431,6 +449,8 @@ class TimeSeries extends Calculator throw $e; } } + + $this->register->get('pools')->reclaim(); } /** @@ -466,7 +486,7 @@ class TimeSeries extends Calculator $query .= "WHERE \"time\" > '{$start}' "; $query .= "AND \"time\" < '{$end}' "; $query .= "AND \"metric_type\"='counter' {$filters} "; - $query .= "GROUP BY time({$period['key']}), \"projectId\", \"projectInternalId\" {$groupBy} "; + $query .= "GROUP BY time({$period['key']}), \"projectId\" {$groupBy} "; $query .= "FILL(null)"; try { @@ -490,7 +510,7 @@ class TimeSeries extends Calculator $value = (!empty($point['value'])) ? $point['value'] : 0; $this->createOrUpdateMetric( - $point['projectInternalId'], + $point['projectId'], $point['time'], $period['key'], $metricUpdated, From 1db29e7674a685cbb5f1162b587beba923264a73 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 31 Oct 2022 08:42:33 +0000 Subject: [PATCH 02/76] appwrite logs --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d1d10c8a1..f5da75777d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,6 +31,8 @@ jobs: docker compose build appwrite docker compose up -d sleep 30 + - name: logs + run: docker compose logs appwrite - name: Doctor run: docker compose exec -T appwrite doctor From 86d377722bce9c957cc36db4c7bd34ed4c6823ba Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 31 Oct 2022 10:35:33 +0000 Subject: [PATCH 03/76] composer update --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 86d47f4a19..47b30929f8 100644 --- a/composer.lock +++ b/composer.lock @@ -5152,5 +5152,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From 3f3aea37d8ea459ccc76fe824545a9311bb2e898 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 1 Nov 2022 06:08:10 +0000 Subject: [PATCH 04/76] update utopia libraries --- composer.json | 6 +++--- composer.lock | 57 ++++++++++++++++++++++----------------------------- 2 files changed, 27 insertions(+), 36 deletions(-) diff --git a/composer.json b/composer.json index 1748f7cac6..29a351aa1e 100644 --- a/composer.json +++ b/composer.json @@ -45,13 +45,13 @@ "appwrite/php-runtimes": "0.11.*", "utopia-php/framework": "0.21.*", "utopia-php/logger": "0.3.*", - "utopia-php/abuse": "0.15.*", + "utopia-php/abuse": "0.16.*", "utopia-php/analytics": "0.2.*", - "utopia-php/audit": "0.16.*", + "utopia-php/audit": "0.17.*", "utopia-php/cache": "0.8.*", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "dev-feat-update-create as 0.27.0", + "utopia-php/database": "0.28.*", "utopia-php/locale": "0.4.*", "utopia-php/registry": "0.5.*", "utopia-php/preloader": "0.2.*", diff --git a/composer.lock b/composer.lock index 47b30929f8..5a81dafebd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c33b697a2f1422eb6fccfd860a7e0169", + "content-hash": "e44426d5884ef97987ebbb711a9ee189", "packages": [ { "name": "adhocore/jwt", @@ -1462,23 +1462,23 @@ }, { "name": "utopia-php/abuse", - "version": "0.15.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "fa7684d3162d370cf17df349066dd6535dd7264a" + "reference": "6370d9150425460416583feba0990504ac789e98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/fa7684d3162d370cf17df349066dd6535dd7264a", - "reference": "fa7684d3162d370cf17df349066dd6535dd7264a", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/6370d9150425460416583feba0990504ac789e98", + "reference": "6370d9150425460416583feba0990504ac789e98", "shasum": "" }, "require": { "ext-curl": "*", "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.27.*" + "utopia-php/database": "0.28.*" }, "require-dev": { "phpunit/phpunit": "^9.4", @@ -1510,9 +1510,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.15.0" + "source": "https://github.com/utopia-php/abuse/tree/0.16.0" }, - "time": "2022-10-30T08:11:12+00:00" + "time": "2022-10-31T14:46:41+00:00" }, { "name": "utopia-php/analytics", @@ -1571,22 +1571,22 @@ }, { "name": "utopia-php/audit", - "version": "0.16.0", + "version": "0.17.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef" + "reference": "455471bd4de8d74026809e843f8c9740eb32922c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef", - "reference": "fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/455471bd4de8d74026809e843f8c9740eb32922c", + "reference": "455471bd4de8d74026809e843f8c9740eb32922c", "shasum": "" }, "require": { "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.27.*" + "utopia-php/database": "0.28.*" }, "require-dev": { "phpunit/phpunit": "^9.3", @@ -1612,9 +1612,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.16.0" + "source": "https://github.com/utopia-php/audit/tree/0.17.0" }, - "time": "2022-10-30T08:11:26+00:00" + "time": "2022-10-31T14:44:52+00:00" }, { "name": "utopia-php/cache", @@ -1771,16 +1771,16 @@ }, { "name": "utopia-php/database", - "version": "dev-feat-update-create", + "version": "0.28.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "8ba52f4ce40674ed9f6e8f72e300d5d9a4900590" + "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/8ba52f4ce40674ed9f6e8f72e300d5d9a4900590", - "reference": "8ba52f4ce40674ed9f6e8f72e300d5d9a4900590", + "url": "https://api.github.com/repos/utopia-php/database/zipball/ef6506af1c09c22f5dc1e7859159d323f7fafa94", + "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94", "shasum": "" }, "require": { @@ -1819,9 +1819,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/feat-update-create" + "source": "https://github.com/utopia-php/database/tree/0.28.0" }, - "time": "2022-10-28T12:01:54+00:00" + "time": "2022-10-31T09:58:46+00:00" }, { "name": "utopia-php/domains", @@ -5117,18 +5117,9 @@ "time": "2022-09-28T08:42:51+00:00" } ], - "aliases": [ - { - "package": "utopia-php/database", - "version": "dev-feat-update-create", - "alias": "0.27.0", - "alias_normalized": "0.27.0.0" - } - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/database": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -5152,5 +5143,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From fee0ec960927da52183d641be719d41fc5f9b7bf Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 2 Nov 2022 01:35:07 +0000 Subject: [PATCH 05/76] remove vendor framework mount --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 081d330f1a..1ab2776efb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,7 +84,7 @@ services: - ./public:/usr/src/code/public - ./src:/usr/src/code/src - ./dev:/usr/local/dev - - ./vendor/utopia-php/framework:/usr/src/code/vendor/utopia-php/framework + depends_on: - mariadb - redis From 777ed70669cf53ead2fce2a02e1ac38ab10c1441 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 2 Nov 2022 05:35:54 +0000 Subject: [PATCH 06/76] composer update --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 5a81dafebd..3494350421 100644 --- a/composer.lock +++ b/composer.lock @@ -5143,5 +5143,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From 85920e5b147cbdf5008894c5ad55183188b58a81 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 2 Nov 2022 05:38:46 +0000 Subject: [PATCH 07/76] fix missing mariadb --- app/controllers/api/databases.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 6dbb607ce4..ab62ba15a9 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -48,6 +48,7 @@ use Appwrite\Utopia\Database\Validator\Queries\Databases; use Appwrite\Utopia\Database\Validator\Queries\Documents; use Utopia\Config\Config; use MaxMind\Db\Reader; +use Utopia\Database\Adapter\MariaDB; /** * Create attribute of varying type From fb120be78ee8397a5a0b36557a434b4f5fadd71d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 2 Nov 2022 05:48:17 +0000 Subject: [PATCH 08/76] get projectdb on CLI --- app/cli.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/cli.php b/app/cli.php index 3a62c80816..248eec3353 100644 --- a/app/cli.php +++ b/app/cli.php @@ -12,6 +12,7 @@ use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Validator\Authorization; use InfluxDB\Database as InfluxDatabase; +use Utopia\Database\Document; function getInfluxDB(): InfluxDatabase { @@ -59,6 +60,28 @@ function getConsoleDB(): Database return $database; } +function getProjectDB(Document $project): Database +{ + global $register; + + $pools = $register->get('pools'); /** @var \Utopia\Pools\Group $pools */ + + if ($project->isEmpty() || $project->getId() === 'console') { + return getConsoleDB(); + } + + $dbAdapter = $pools + ->get($project->getAttribute('database')) + ->pop() + ->getResource() + ; + + $database = new Database($dbAdapter, getCache()); + $database->setNamespace('_' . $project->getInternalId()); + + return $database; +} + function getCache(): Cache { global $register; From cd4b7c1c36fd95af39046cc6cf59b4dd267aabd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 16 Nov 2022 09:15:34 +0000 Subject: [PATCH 09/76] Improve git prebuilds --- .gitpod.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index a63c07bad2..dd4f406132 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,8 +1,9 @@ tasks: - name: Run Appwrite Docker Stack init: | - docker compose pull + git pull --recurse-submodules docker compose build + docker compose pull docker pull composer command: | docker run --rm --interactive --tty \ From 74eaef4e9d7074953bd76bb9ac0be07b3a56b82f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 17 Nov 2022 05:51:12 +0545 Subject: [PATCH 10/76] remove unused import --- app/controllers/api/databases.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 2a56fe0183..5022681d87 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -47,7 +47,6 @@ use Appwrite\Utopia\Database\Validator\Queries\Databases; use Appwrite\Utopia\Database\Validator\Queries\Documents; use Utopia\Config\Config; use MaxMind\Db\Reader; -use Utopia\Database\Adapter\MariaDB; /** * Create attribute of varying type From 9f92214c9d1a12d822a5f3ed7b09c6999062c03d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 17 Nov 2022 00:36:51 +0000 Subject: [PATCH 11/76] update usage --- src/Appwrite/Platform/Tasks/Usage.php | 56 +++++++-------------------- 1 file changed, 15 insertions(+), 41 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/Usage.php b/src/Appwrite/Platform/Tasks/Usage.php index 73686109d8..6cf20e737d 100644 --- a/src/Appwrite/Platform/Tasks/Usage.php +++ b/src/Appwrite/Platform/Tasks/Usage.php @@ -12,6 +12,7 @@ use Utopia\Database\Database as UtopiaDatabase; use Utopia\Validator\WhiteList; use Throwable; use Utopia\Platform\Action; +use Utopia\Registry\Registry; class Usage extends Action { @@ -24,17 +25,28 @@ class Usage extends Action { $this ->desc('Schedules syncing data from influxdb to Appwrite console db') - ->param('type', 'timeseries', new WhiteList(['timeseries', 'database'])) ->inject('dbForConsole') ->inject('influxdb') + ->inject('register') + ->inject('getProjectDB') ->inject('logError') - ->callback(fn ($type, $dbForConsole, $influxDB, $logError) => $this->action($type, $dbForConsole, $influxDB, $logError)); + ->callback(fn ($dbForConsole, $influxDB, $register, $getProjectDB, $logError) => $this->action($dbForConsole, $influxDB, $register, $getProjectDB, $logError)); } protected function aggregateTimeseries(UtopiaDatabase $database, InfluxDatabase $influxDB, callable $logError): void { + + } + + public function action(UtopiaDatabase $dbForConsole, InfluxDatabase $influxDB, Registry $register, callable $getProjectDB, callable $logError) + { + Console::title('Usage Aggregation V1'); + Console::success(APP_NAME . ' usage aggregation process v1 has started'); + + $errorLogger = fn(Throwable $error, string $action = 'syncUsageStats') => $logError($error, "usage", $action); + $interval = (int) App::getEnv('_APP_USAGE_TIMESERIES_INTERVAL', '30'); // 30 seconds (by default) - $usage = new TimeSeries($database, $influxDB, $logError); + $usage = new TimeSeries($dbForConsole, $influxDB, $getProjectDB, $register, $errorLogger); Console::loop(function () use ($interval, $usage) { $now = date('d-m-Y H:i:s', time()); @@ -48,42 +60,4 @@ class Usage extends Action Console::info("[{$now}] Aggregation took {$loopTook} seconds"); }, $interval); } - - protected function aggregateDatabase(UtopiaDatabase $database, callable $logError): void - { - $interval = (int) App::getEnv('_APP_USAGE_DATABASE_INTERVAL', '900'); // 15 minutes (by default) - $usage = new Database($database, $logError); - $aggregrator = new Aggregator($database, $logError); - - Console::loop(function () use ($interval, $usage, $aggregrator) { - $now = date('d-m-Y H:i:s', time()); - Console::info("[{$now}] Aggregating database usage every {$interval} seconds."); - $loopStart = microtime(true); - $usage->collect(); - $aggregrator->collect(); - $loopTook = microtime(true) - $loopStart; - $now = date('d-m-Y H:i:s', time()); - - Console::info("[{$now}] Aggregation took {$loopTook} seconds"); - }, $interval); - } - - public function action(string $type, UtopiaDatabase $dbForConsole, InfluxDatabase $influxDB, callable $logError) - { - Console::title('Usage Aggregation V1'); - Console::success(APP_NAME . ' usage aggregation process v1 has started'); - - $errorLogger = fn(Throwable $error, string $action = 'syncUsageStats') => $logError($error, "usage", $action); - - switch ($type) { - case 'timeseries': - $this->aggregateTimeseries($dbForConsole, $influxDB, $errorLogger); - break; - case 'database': - $this->aggregateDatabase($dbForConsole, $errorLogger); - break; - default: - Console::error("Unsupported usage aggregation type"); - } - } } From baddbf7f03ced61c2ccfaf02267fff0113bf9beb Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 17 Nov 2022 00:38:44 +0000 Subject: [PATCH 12/76] remove unused code --- src/Appwrite/Platform/Tasks/Usage.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/Usage.php b/src/Appwrite/Platform/Tasks/Usage.php index 6cf20e737d..d083839145 100644 --- a/src/Appwrite/Platform/Tasks/Usage.php +++ b/src/Appwrite/Platform/Tasks/Usage.php @@ -2,14 +2,11 @@ namespace Appwrite\Platform\Tasks; -use Appwrite\Usage\Calculators\Aggregator; -use Appwrite\Usage\Calculators\Database; use Appwrite\Usage\Calculators\TimeSeries; use InfluxDB\Database as InfluxDatabase; use Utopia\App; use Utopia\CLI\Console; use Utopia\Database\Database as UtopiaDatabase; -use Utopia\Validator\WhiteList; use Throwable; use Utopia\Platform\Action; use Utopia\Registry\Registry; From 3439978253a348c258316bb87c0dc9fd6873be84 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 17 Nov 2022 00:39:33 +0000 Subject: [PATCH 13/76] formatting --- src/Appwrite/Platform/Tasks/Usage.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/Usage.php b/src/Appwrite/Platform/Tasks/Usage.php index d083839145..1315d71c39 100644 --- a/src/Appwrite/Platform/Tasks/Usage.php +++ b/src/Appwrite/Platform/Tasks/Usage.php @@ -32,7 +32,6 @@ class Usage extends Action protected function aggregateTimeseries(UtopiaDatabase $database, InfluxDatabase $influxDB, callable $logError): void { - } public function action(UtopiaDatabase $dbForConsole, InfluxDatabase $influxDB, Registry $register, callable $getProjectDB, callable $logError) From 3353bad8ffb91b78136f61be6fbdbffde3c015c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 18 Nov 2022 08:03:01 +0100 Subject: [PATCH 14/76] Apply suggestions from code review --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index dd4f406132..4c081dd275 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,7 +1,7 @@ tasks: - name: Run Appwrite Docker Stack init: | - git pull --recurse-submodules + git submodule update --init docker compose build docker compose pull docker pull composer From 4a61718cff790583a99bb729a1577198d522a860 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 21 Nov 2022 16:49:45 +1300 Subject: [PATCH 15/76] Enable HSTS for all HTTPS requests --- app/controllers/general.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/general.php b/app/controllers/general.php index 069a918680..0c10dd46e9 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -223,7 +223,9 @@ App::init() return $response->redirect('https://' . $request->getHostname() . $request->getURI()); } + } + if ($request->getProtocol() === 'https') { $response->addHeader('Strict-Transport-Security', 'max-age=' . (60 * 60 * 24 * 126)); // 126 days } From 0ee49e78958fadbaac8df1c7245d60ed57bb7a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 09:38:36 +0000 Subject: [PATCH 16/76] Fix missing execution status --- app/controllers/api/functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 4cf489e590..fe2074a28b 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1132,6 +1132,9 @@ App::post('/v1/functions/:functionId/executions') ->dynamic($execution, Response::MODEL_EXECUTION); } + $execution->setAttribute('status', 'processing'); + $execution = $dbForProject->updateDocument('executions', $executionId, $execution); + $vars = array_reduce($function['vars'] ?? [], function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value') ?? ''; return $carry; From 8feb3dc43c0bbe30a7322d477c46b5ed8a39e8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 09:40:50 +0000 Subject: [PATCH 17/76] Update changelog --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 6b7af775de..fc1a2d178e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,5 @@ +- Fix processing status on sync executions [#4737](https://github.com/appwrite/appwrite/pull/4737) + # Version 1.1.1 ## Bugs From 831960245f800f0bcc3a673288a01292dadf4b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 11:20:52 +0000 Subject: [PATCH 18/76] Permission bug fix --- app/controllers/api/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index fe2074a28b..871998e6de 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1133,7 +1133,7 @@ App::post('/v1/functions/:functionId/executions') } $execution->setAttribute('status', 'processing'); - $execution = $dbForProject->updateDocument('executions', $executionId, $execution); + Authorization::skip(fn () => $dbForProject->updateDocument('executions', $executionId, $execution)); $vars = array_reduce($function['vars'] ?? [], function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value') ?? ''; From d2362aeab0427fa7740f8d944873a0ef036d7fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 11:43:20 +0000 Subject: [PATCH 19/76] Improve performance --- app/controllers/api/functions.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 871998e6de..bfc1ccba42 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1080,7 +1080,7 @@ App::post('/v1/functions/:functionId/executions') 'functionId' => $function->getId(), 'deploymentId' => $deployment->getId(), 'trigger' => 'http', // http / schedule / event - 'status' => 'waiting', // waiting / processing / completed / failed + 'status' => $async ? 'waiting' : 'processing', // waiting / processing / completed / failed 'statusCode' => 0, 'response' => '', 'stderr' => '', @@ -1132,9 +1132,6 @@ App::post('/v1/functions/:functionId/executions') ->dynamic($execution, Response::MODEL_EXECUTION); } - $execution->setAttribute('status', 'processing'); - Authorization::skip(fn () => $dbForProject->updateDocument('executions', $executionId, $execution)); - $vars = array_reduce($function['vars'] ?? [], function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value') ?? ''; return $carry; From e7fc427291057eca6c2f91bb05b6215f5d4627a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 15:10:55 +0100 Subject: [PATCH 20/76] Remove failing test --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 6d421484f3..29ceb1254f 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -550,7 +550,6 @@ class FunctionsCustomServerTest extends Scope $this->assertIsArray($function['body']['deployments']); $this->assertCount(2, $function['body']['deployments']); $this->assertEquals($function['body']['deployments'][0]['$id'], $data['deploymentId']); - $this->assertGreaterThanOrEqual(2, $function['body']['deployments'][0]['buildTime']); return $data; } From 202e4c01d8f4054b9b359892e2d4110296d6f7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 14:23:43 +0000 Subject: [PATCH 21/76] Add new executor env vars --- .env | 1 + app/config/variables.php | 11 ++++++++++- app/views/install/compose.phtml | 1 + docker-compose.yml | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 15a25aa933..4656731909 100644 --- a/.env +++ b/.env @@ -53,6 +53,7 @@ _APP_FUNCTIONS_BUILD_TIMEOUT=900 _APP_FUNCTIONS_CPUS=1 _APP_FUNCTIONS_MEMORY=512 _APP_FUNCTIONS_INACTIVE_THRESHOLD=600 +_APP_FUNCTIONS_MAINTENANCE_INTERVAL=600 _APP_FUNCTIONS_RUNTIMES_NETWORK=runtimes _APP_EXECUTOR_SECRET=your-secret-key _APP_EXECUTOR_HOST=http://exc1/v1 diff --git a/app/config/variables.php b/app/config/variables.php index 1eb2688c62..474ec70d66 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -877,7 +877,16 @@ return [ 'required' => false, 'question' => '', 'filter' => '' - ] + ], + [ + 'name' => '_APP_FUNCTIONS_MAINTENANCE_INTERVAL', + 'description' => 'Interval how often executor checks for inactive runimes. The default value is 60 seconds.', + 'introduction' => '1.2.0', + 'default' => '60', + 'required' => false, + 'question' => '', + 'filter' => '' + ], ], ], [ diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index dc7549aa3f..c1939c46c2 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -558,6 +558,7 @@ services: environment: - OPR_EXECUTOR_CONNECTION_STORAGE=$_APP_CONNECTIONS_STORAGE - OPR_EXECUTOR_INACTIVE_TRESHOLD=$_APP_FUNCTIONS_INACTIVE_THRESHOLD + - OPR_EXECUTOR_MAINTENANCE_INTERVAL=$_APP_FUNCTIONS_MAINTENANCE_INTERVAL - OPR_EXECUTOR_NETWORK=$_APP_FUNCTIONS_RUNTIMES_NETWORK - OPR_EXECUTOR_DOCKER_HUB_USERNAME=$_APP_DOCKER_HUB_USERNAME - OPR_EXECUTOR_DOCKER_HUB_PASSWORD=$_APP_DOCKER_HUB_PASSWORD diff --git a/docker-compose.yml b/docker-compose.yml index cb18dff4ea..82b85ba733 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -650,6 +650,7 @@ services: environment: - OPR_EXECUTOR_CONNECTION_STORAGE=$_APP_CONNECTIONS_STORAGE - OPR_EXECUTOR_INACTIVE_TRESHOLD=$_APP_FUNCTIONS_INACTIVE_THRESHOLD + - OPR_EXECUTOR_MAINTENANCE_INTERVAL=$_APP_FUNCTIONS_MAINTENANCE_INTERVAL - OPR_EXECUTOR_NETWORK=$_APP_FUNCTIONS_RUNTIMES_NETWORK - OPR_EXECUTOR_DOCKER_HUB_USERNAME=$_APP_DOCKER_HUB_USERNAME - OPR_EXECUTOR_DOCKER_HUB_PASSWORD=$_APP_DOCKER_HUB_PASSWORD From dd99ab7b0022bd963813b3a09d7efa90a13f2c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 14:24:52 +0000 Subject: [PATCH 22/76] Fix session expiration --- app/init.php | 4 ++-- app/tasks/maintenance.php | 1 - app/workers/deletes.php | 23 ++++++++++++++--------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/init.php b/app/init.php index 3d24ef81d4..50624c21c8 100644 --- a/app/init.php +++ b/app/init.php @@ -790,9 +790,11 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons Authorization::setDefaultStatus(true); Auth::setCookieName('a_session_' . $project->getId()); + $authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG; if (APP_MODE_ADMIN === $mode) { Auth::setCookieName('a_session_' . $console->getId()); + $authDuration = Auth::TOKEN_EXPIRATION_LOGIN_LONG; } $session = Auth::decodeSession( @@ -829,8 +831,6 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons $user = $dbForConsole->getDocument('users', Auth::$unique); } - $authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG; - if ( $user->isEmpty() // Check a document has been found in the DB || !Auth::sessionVerify($user->getAttribute('sessions', []), Auth::$secret, $authDuration) diff --git a/app/tasks/maintenance.php b/app/tasks/maintenance.php index 96264a9966..7199a338e3 100644 --- a/app/tasks/maintenance.php +++ b/app/tasks/maintenance.php @@ -98,7 +98,6 @@ $cli { (new Delete()) ->setType(DELETE_TYPE_SESSIONS) - ->setDatetime(DateTime::addSeconds(new \DateTime(), -1 * Auth::TOKEN_EXPIRATION_LOGIN_LONG)) //TODO: Update to use project session expiration instead of default. ->trigger(); } diff --git a/app/workers/deletes.php b/app/workers/deletes.php index 364e64842f..5dc7e8d737 100644 --- a/app/workers/deletes.php +++ b/app/workers/deletes.php @@ -1,5 +1,6 @@ deleteExpiredSessions($this->args['datetime']); + $this->deleteExpiredSessions(); break; case DELETE_TYPE_CERTIFICATES: @@ -105,7 +107,7 @@ class DeletesV1 extends Worker break; case DELETE_TYPE_USAGE: - $this->deleteUsageStats($this->args['dateTime1d'], $this->args['hourlyUsageRetentionDatetime']); + $this->deleteUsageStats($this->args['hourlyUsageRetentionDatetime']); break; case DELETE_TYPE_CACHE_BY_RESOURCE: @@ -214,7 +216,6 @@ class DeletesV1 extends Worker } /** - * @param string $datetime1d * @param string $hourlyUsageRetentionDatetime */ protected function deleteUsageStats(string $hourlyUsageRetentionDatetime) @@ -316,16 +317,20 @@ class DeletesV1 extends Worker }); } - /** - * @param string $datetime - */ - protected function deleteExpiredSessions(string $datetime): void + protected function deleteExpiredSessions(): void { - $this->deleteForProjectIds(function (string $projectId) use ($datetime) { + $consoleDB = $this->getConsoleDB(); + + $this->deleteForProjectIds(function (string $projectId) use ($consoleDB) { $dbForProject = $this->getProjectDB($projectId); + + $project = $consoleDB->getDocument('projects', $projectId); + $duration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG; + $expired = DateTime::addSeconds(new \DateTime(), -1 * $duration); + // Delete Sessions $this->deleteByGroup('sessions', [ - Query::lessThan('expire', $datetime) + Query::lessThan('$createdAt', $expired) ], $dbForProject); }); } From eda112755ae4fbf017b5426f42f55995f36f6baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 14:26:59 +0000 Subject: [PATCH 23/76] Update changelogs --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 6b7af775de..359f39fb4d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,5 @@ +- Fix admin-mode session expiration, and expired session deletion [#4739](https://github.com/appwrite/appwrite/pull/4739) + # Version 1.1.1 ## Bugs From e20b2f33403a6c246c02506f42dd59366eefb432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 14:55:57 +0000 Subject: [PATCH 24/76] Upgrade OPR images --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 82b85ba733..59661a15c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -638,7 +638,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.1.4 + image: openruntimes/executor:0.1.6 networks: - appwrite - runtimes From 7f95ff31bde192c2d0ca4b580f2df8eeccb4e0d1 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Mon, 21 Nov 2022 15:37:34 +0000 Subject: [PATCH 25/76] Updated the error descriptions for better SEO. --- app/config/errors.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/errors.php b/app/config/errors.php index e4dc3d5b4d..c5c6a489b8 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -70,7 +70,7 @@ return [ ], Exception::GENERAL_ROUTE_NOT_FOUND => [ 'name' => Exception::GENERAL_ROUTE_NOT_FOUND, - 'description' => 'The requested route was not found. Please refer to the docs and try again.', + 'description' => 'The requested route was not found. Please refer to the API docs and try again.', 'code' => 404, ], Exception::GENERAL_CURSOR_NOT_FOUND => [ @@ -486,7 +486,7 @@ return [ ], Exception::PROJECT_PROVIDER_UNSUPPORTED => [ 'name' => Exception::PROJECT_PROVIDER_UNSUPPORTED, - 'description' => 'The chosen OAuth provider is unsupported. Please check the docs for the complete list of supported OAuth providers.', + 'description' => 'The chosen OAuth provider is unsupported. Please check the Create OAuth2 Session docs for the complete list of supported OAuth providers.', 'code' => 501, ], Exception::PROJECT_INVALID_SUCCESS_URL => [ From f055adc05f9bbe95becaec5d69cf2181db18667c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 22 Nov 2022 07:17:56 +0000 Subject: [PATCH 26/76] Fix pool sharing logic --- .env | 3 ++- app/init.php | 14 ++++++++++---- docker-compose.yml | 2 ++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 4656731909..b8bc2d93cf 100644 --- a/.env +++ b/.env @@ -24,7 +24,8 @@ _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password _APP_DB_ROOT_PASS=rootsecretpassword -_APP_CONNECTIONS_MAX=251 +_APP_CONNECTIONS_MAX=151 +_APP_POOL_CLIENTS=14 _APP_CONNECTIONS_DB_PROJECT=db_fra1_02=mariadb://user:password@mariadb:3306/appwrite _APP_CONNECTIONS_DB_CONSOLE=db_fra1_01=mariadb://user:password@mariadb:3306/appwrite _APP_CONNECTIONS_CACHE=redis_fra1_01=redis://redis:6379 diff --git a/app/init.php b/app/init.php index 5016a4246c..04e5387381 100644 --- a/app/init.php +++ b/app/init.php @@ -552,10 +552,16 @@ $register->set('pools', function () { ], ]; - $instances = 3; // REST, Realtime, CLI - $workerCount = swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6)); - $maxConnections = App::getenv('_APP_CONNECTIONS_MAX', 251); - $instanceConnections = $maxConnections / $instances; + $maxConnections = App::getenv('_APP_CONNECTIONS_MAX', 151); + $instanceConnections = $maxConnections / App::getenv('_APP_POOL_CLIENTS', 14); + + $multiprocessing = App::getenv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled'; + + if($multiprocessing) { + $workerCount = swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6)); + } else { + $workerCount = 1; + } if ($workerCount > $instanceConnections) { throw new \Exception('Pool size is too small. Increase the number of allowed database connections or decrease the number of workers.', 500); diff --git a/docker-compose.yml b/docker-compose.yml index 59661a15c5..59907aaf04 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -105,6 +105,7 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_SERVER_MULTIPROCESS=enabled - _APP_LOCALE - _APP_CONSOLE_WHITELIST_ROOT - _APP_CONSOLE_WHITELIST_EMAILS @@ -204,6 +205,7 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_SERVER_MULTIPROCESS=enabled - _APP_OPTIONS_ABUSE - _APP_OPENSSL_KEY_V1 - _APP_DB_HOST From ced481f78c22bb7ee74038cddb13a56fd7badc4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 22 Nov 2022 07:57:44 +0000 Subject: [PATCH 27/76] Linter, library upgrade --- app/init.php | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/init.php b/app/init.php index 04e5387381..550dc6d744 100644 --- a/app/init.php +++ b/app/init.php @@ -557,7 +557,7 @@ $register->set('pools', function () { $multiprocessing = App::getenv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled'; - if($multiprocessing) { + if ($multiprocessing) { $workerCount = swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6)); } else { $workerCount = 1; diff --git a/composer.lock b/composer.lock index f47d853d6b..c41db9e924 100644 --- a/composer.lock +++ b/composer.lock @@ -2356,16 +2356,16 @@ }, { "name": "utopia-php/pools", - "version": "0.4.1", + "version": "0.4.2", "source": { "type": "git", "url": "https://github.com/utopia-php/pools.git", - "reference": "c8f96a33e7fbf58c1145eb6cf0f2c00cbe319979" + "reference": "d2870ab74b31b7f4027799f082e85122154f8bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/pools/zipball/c8f96a33e7fbf58c1145eb6cf0f2c00cbe319979", - "reference": "c8f96a33e7fbf58c1145eb6cf0f2c00cbe319979", + "url": "https://api.github.com/repos/utopia-php/pools/zipball/d2870ab74b31b7f4027799f082e85122154f8bed", + "reference": "d2870ab74b31b7f4027799f082e85122154f8bed", "shasum": "" }, "require": { @@ -2401,9 +2401,9 @@ ], "support": { "issues": "https://github.com/utopia-php/pools/issues", - "source": "https://github.com/utopia-php/pools/tree/0.4.1" + "source": "https://github.com/utopia-php/pools/tree/0.4.2" }, - "time": "2022-11-15T08:55:16+00:00" + "time": "2022-11-22T07:55:45+00:00" }, { "name": "utopia-php/preloader", @@ -5403,5 +5403,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } From 8ea6647b22feaf8d55dbf2f07d8ec477eabc2bc4 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 22 Nov 2022 13:56:50 +0000 Subject: [PATCH 28/76] feat: update branch --- .env | 4 +- .github/workflows/tests.yml | 3 +- app/console | 2 +- app/controllers/api/projects.php | 112 ------------------------------- composer.json | 10 +-- composer.lock | 14 ++-- 6 files changed, 16 insertions(+), 129 deletions(-) diff --git a/.env b/.env index 4e86263840..9cac2e6438 100644 --- a/.env +++ b/.env @@ -62,10 +62,10 @@ _APP_MAINTENANCE_RETENTION_CACHE=2592000 _APP_MAINTENANCE_RETENTION_EXECUTION=1209600 _APP_MAINTENANCE_RETENTION_ABUSE=86400 _APP_MAINTENANCE_RETENTION_AUDIT=1209600 -_APP_MAINTENANCE_RETENTION_SCHEDULES= 86400 -_APP_USAGE_AGGREGATION_INTERVAL=5 +_APP_MAINTENANCE_RETENTION_SCHEDULES=86400 _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 _APP_USAGE_STATS=enabled +_APP_USAGE_AGGREGATION_INTERVAL=5 _APP_LOGGING_PROVIDER= _APP_LOGGING_CONFIG= _APP_REGION=default diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd9faa39c4..cff75b73b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,8 +33,7 @@ jobs: docker compose build appwrite docker compose up -d sleep 30 - - name: logs - run: docker compose logs appwrite + - name: Doctor run: docker compose exec -T appwrite doctor diff --git a/app/console b/app/console index 4e2cecefb5..25d281795a 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 4e2cecefb571104f0dbbe5a578729f0e17a10242 +Subproject commit 25d281795a1b73c9b7ed37b14c451068c36d2ff1 diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index f6d0a58c19..ac2bb675b5 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -28,7 +28,6 @@ use Utopia\Domains\Domain; use Appwrite\Extend\Exception; use Appwrite\Utopia\Database\Validator\Queries\Projects; use Utopia\Cache\Cache; -use Utopia\Database\Validator\Authorization; use Utopia\Pools\Group; use Utopia\Validator\ArrayList; use Utopia\Validator\Boolean; @@ -252,117 +251,6 @@ App::get('/v1/projects/:projectId') $response->dynamic($project, Response::MODEL_PROJECT); }); -App::get('/v1/projects/:projectId/usage') - ->desc('Get usage stats for a project') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_PROJECT) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), 'Date range.', true) - ->inject('response') - ->inject('dbForConsole') - ->inject('dbForProject') - ->action(function (string $projectId, string $range, Response $response, Database $dbForConsole, Database $dbForProject) { - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND); - } - - $usage = []; - if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { - $periods = [ - '24h' => [ - 'period' => '1h', - 'limit' => 24, - ], - '7d' => [ - 'period' => '1d', - 'limit' => 7, - ], - '30d' => [ - 'period' => '1d', - 'limit' => 30, - ], - '90d' => [ - 'period' => '1d', - 'limit' => 90, - ], - ]; - - $dbForProject->setNamespace("_{$project->getInternalId()}"); - - $metrics = [ - 'project.$all.network.requests', - 'project.$all.network.bandwidth', - 'project.$all.storage.size', - 'users.$all.count.total', - 'collections.$all.count.total', - 'documents.$all.count.total', - 'executions.$all.compute.total', - ]; - - $stats = []; - - Authorization::skip(function () use ($dbForProject, $periods, $range, $metrics, &$stats) { - foreach ($metrics as $metric) { - $limit = $periods[$range]['limit']; - $period = $periods[$range]['period']; - - $requestDocs = $dbForProject->find('stats', [ - Query::equal('period', [$period]), - Query::equal('metric', [$metric]), - Query::limit($limit), - Query::orderDesc('time'), - ]); - - $stats[$metric] = []; - foreach ($requestDocs as $requestDoc) { - $stats[$metric][] = [ - 'value' => $requestDoc->getAttribute('value'), - 'date' => $requestDoc->getAttribute('time'), - ]; - } - - // backfill metrics with empty values for graphs - $backfill = $limit - \count($requestDocs); - while ($backfill > 0) { - $last = $limit - $backfill - 1; // array index of last added metric - $diff = match ($period) { // convert period to seconds for unix timestamp math - '1h' => 3600, - '1d' => 86400, - }; - $stats[$metric][] = [ - 'value' => 0, - 'date' => DateTime::formatTz(DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff)), - ]; - $backfill--; - } - $stats[$metric] = array_reverse($stats[$metric]); - } - }); - - $usage = new Document([ - 'range' => $range, - 'requests' => $stats[$metrics[0]] ?? [], - 'network' => $stats[$metrics[1]] ?? [], - 'storage' => $stats[$metrics[2]] ?? [], - 'users' => $stats[$metrics[3]] ?? [], - 'collections' => $stats[$metrics[4]] ?? [], - 'documents' => $stats[$metrics[5]] ?? [], - 'executions' => $stats[$metrics[6]] ?? [], - ]); - } - - $response->dynamic($usage, Response::MODEL_USAGE_PROJECT); - }); - App::patch('/v1/projects/:projectId') ->desc('Update Project') ->groups(['api', 'projects']) diff --git a/composer.json b/composer.json index b2d0d9e846..1d6d1be25b 100644 --- a/composer.json +++ b/composer.json @@ -50,17 +50,17 @@ "utopia-php/cli": "0.14.*", "utopia-php/config": "0.2.*", "utopia-php/database": "0.28.*", - "utopia-php/domains": "1.1.*", - "utopia-php/framework": "0.25.*", - "utopia-php/image": "0.5.*", "utopia-php/queue": "0.5.*", - "utopia-php/locale": "0.4.*", - "utopia-php/logger": "0.3.*", "utopia-php/orchestration": "0.9.*", "utopia-php/platform": "0.3.*", "utopia-php/pools": "0.4.*", "utopia-php/preloader": "0.2.*", + "utopia-php/domains": "1.1.*", + "utopia-php/framework": "0.25.*", + "utopia-php/image": "0.5.*", "utopia-php/dsn": "0.1.*", + "utopia-php/locale": "0.4.*", + "utopia-php/logger": "0.3.*", "utopia-php/messaging": "0.1.*", "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.13.*", diff --git a/composer.lock b/composer.lock index dfeff542b7..7e3705f123 100644 --- a/composer.lock +++ b/composer.lock @@ -2356,16 +2356,16 @@ }, { "name": "utopia-php/pools", - "version": "0.4.1", + "version": "0.4.2", "source": { "type": "git", "url": "https://github.com/utopia-php/pools.git", - "reference": "c8f96a33e7fbf58c1145eb6cf0f2c00cbe319979" + "reference": "d2870ab74b31b7f4027799f082e85122154f8bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/pools/zipball/c8f96a33e7fbf58c1145eb6cf0f2c00cbe319979", - "reference": "c8f96a33e7fbf58c1145eb6cf0f2c00cbe319979", + "url": "https://api.github.com/repos/utopia-php/pools/zipball/d2870ab74b31b7f4027799f082e85122154f8bed", + "reference": "d2870ab74b31b7f4027799f082e85122154f8bed", "shasum": "" }, "require": { @@ -2401,9 +2401,9 @@ ], "support": { "issues": "https://github.com/utopia-php/pools/issues", - "source": "https://github.com/utopia-php/pools/tree/0.4.1" + "source": "https://github.com/utopia-php/pools/tree/0.4.2" }, - "time": "2022-11-15T08:55:16+00:00" + "time": "2022-11-22T07:55:45+00:00" }, { "name": "utopia-php/preloader", @@ -5403,5 +5403,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From dd8a64b3a337cde367a88ca3febef2e23eb62e05 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 22 Nov 2022 14:10:41 +0000 Subject: [PATCH 29/76] feat: update branch --- app/views/install/compose.phtml | 31 --------------------------- src/Appwrite/Platform/Tasks/Usage.php | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 31c5838a1a..37937cfa13 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -494,37 +494,6 @@ services: - _APP_LOGGING_PROVIDER - _APP_LOGGING_CONFIG - appwrite-usage-database: - image: /: - entrypoint: - - usage - - --type=database - container_name: appwrite-usage-database - <<: *x-logging - restart: unless-stopped - networks: - - appwrite - depends_on: - - influxdb - - mariadb - environment: - - _APP_ENV - - _APP_OPENSSL_KEY_V1 - - _APP_DB_HOST - - _APP_DB_PORT - - _APP_DB_SCHEMA - - _APP_DB_USER - - _APP_DB_PASS - - _APP_REDIS_HOST - - _APP_REDIS_PORT - - _APP_REDIS_USER - - _APP_REDIS_PASS - - _APP_INFLUXDB_HOST - - _APP_INFLUXDB_PORT - - _APP_USAGE_TIMESERIES_INTERVAL - - _APP_LOGGING_PROVIDER - - _APP_LOGGING_CONFIG - appwrite-schedule: image: /: entrypoint: schedule diff --git a/src/Appwrite/Platform/Tasks/Usage.php b/src/Appwrite/Platform/Tasks/Usage.php index 152523fd37..fa677ea142 100644 --- a/src/Appwrite/Platform/Tasks/Usage.php +++ b/src/Appwrite/Platform/Tasks/Usage.php @@ -41,7 +41,7 @@ class Usage extends Action $errorLogger = fn(Throwable $error, string $action = 'syncUsageStats') => $logError($error, "usage", $action); - $interval = (int) App::getEnv('_APP_USAGE_TIMESERIES_INTERVAL', '30'); // 30 seconds (by default) + $interval = (int) App::getEnv('_APP_USAGE_AGGREGATION_INTERVAL', '30'); // 30 seconds (by default) $region = App::getEnv('region', 'default'); $usage = new TimeSeries($region, $dbForConsole, $influxDB, $getProjectDB, $register, $errorLogger); From a47618e01a05f00d6a6e32437c2d5c483d512bd5 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 22 Nov 2022 14:17:18 +0000 Subject: [PATCH 30/76] feat: update branch --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 9cac2e6438..401f2e9ce8 100644 --- a/.env +++ b/.env @@ -65,7 +65,7 @@ _APP_MAINTENANCE_RETENTION_AUDIT=1209600 _APP_MAINTENANCE_RETENTION_SCHEDULES=86400 _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 _APP_USAGE_STATS=enabled -_APP_USAGE_AGGREGATION_INTERVAL=5 +_APP_USAGE_AGGREGATION_INTERVAL=30 _APP_LOGGING_PROVIDER= _APP_LOGGING_CONFIG= _APP_REGION=default From 85de5e9106f5af9c516958efec2d1d498815f51d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 22 Nov 2022 20:14:39 +0530 Subject: [PATCH 31/76] feat: update droplet config --- .env | 2 +- app/console | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index b7de838c7f..6b31bc1620 100644 --- a/.env +++ b/.env @@ -24,7 +24,7 @@ _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password _APP_DB_ROOT_PASS=rootsecretpassword -_APP_CONNECTIONS_MAX=151 +_APP_CONNECTIONS_MAX=300 _APP_POOL_CLIENTS=14 _APP_CONNECTIONS_DB_PROJECT=db_fra1_02=mariadb://user:password@mariadb:3306/appwrite _APP_CONNECTIONS_DB_CONSOLE=db_fra1_01=mariadb://user:password@mariadb:3306/appwrite diff --git a/app/console b/app/console index 25d281795a..4e2cecefb5 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 25d281795a1b73c9b7ed37b14c451068c36d2ff1 +Subproject commit 4e2cecefb571104f0dbbe5a578729f0e17a10242 From 2ef43e3249b8275d5cb20ab371ea1afb4c56e550 Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Tue, 22 Nov 2022 16:36:15 +0100 Subject: [PATCH 32/76] Improvements during QA --- .env | 4 ++-- app/controllers/shared/api.php | 1 - app/workers/functions.php | 5 ++++- docker-compose.yml | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.env b/.env index b8bc2d93cf..28161098ad 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ _APP_ENV=development _APP_LOCALE=en -_APP_WORKER_PER_CORE=6 +_APP_WORKER_PER_CORE=2 _APP_CONSOLE_WHITELIST_ROOT=disabled _APP_CONSOLE_WHITELIST_EMAILS= _APP_CONSOLE_WHITELIST_IPS= @@ -24,7 +24,7 @@ _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password _APP_DB_ROOT_PASS=rootsecretpassword -_APP_CONNECTIONS_MAX=151 +_APP_CONNECTIONS_MAX=251 _APP_POOL_CLIENTS=14 _APP_CONNECTIONS_DB_PROJECT=db_fra1_02=mariadb://user:password@mariadb:3306/appwrite _APP_CONNECTIONS_DB_CONSOLE=db_fra1_01=mariadb://user:password@mariadb:3306/appwrite diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index db35cebc65..324efa6109 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -192,7 +192,6 @@ App::init() ->setUser($user); $usage - ->setParam('projectInternalId', $project->getInternalId()) ->setParam('projectId', $project->getId()) ->setParam('project.{scope}.network.requests', 1) ->setParam('httpMethod', $request->getMethod()) diff --git a/app/workers/functions.php b/app/workers/functions.php index 3047bf027e..a0c9bbdbac 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -152,6 +152,10 @@ Server::setResource('execute', function () { ->setAttribute('status', 'failed') ->setAttribute('statusCode', $th->getCode()) ->setAttribute('stderr', $th->getMessage()); + + Console::error($th->getTraceAsString()); + Console::error($th->getFile()); + Console::error($th->getLine()); Console::error($th->getMessage()); } @@ -204,7 +208,6 @@ Server::setResource('execute', function () { $usage = new Stats($statsd); $usage ->setParam('projectId', $project->getId()) - ->setParam('projectInternalId', $project->getInternalId()) ->setParam('functionId', $function->getId()) ->setParam('executions.{scope}.compute', 1) ->setParam('executionStatus', $execution->getAttribute('status', '')) diff --git a/docker-compose.yml b/docker-compose.yml index 59907aaf04..f0e1636742 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -126,6 +126,7 @@ services: - _APP_DB_USER - _APP_DB_PASS - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER @@ -214,6 +215,7 @@ services: - _APP_DB_USER - _APP_DB_PASS - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER @@ -277,6 +279,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS - _APP_REDIS_HOST @@ -308,6 +312,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_DB_HOST - _APP_DB_PORT @@ -344,6 +350,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_DB_HOST - _APP_DB_PORT @@ -377,6 +385,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_EXECUTOR_SECRET - _APP_EXECUTOR_HOST @@ -415,6 +425,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_DOMAIN - _APP_DOMAIN_TARGET @@ -452,6 +464,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_DB_HOST - _APP_DB_PORT @@ -490,6 +504,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_SYSTEM_EMAIL_NAME - _APP_SYSTEM_EMAIL_ADDRESS @@ -521,6 +537,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER @@ -546,6 +564,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_DOMAIN - _APP_DOMAIN_TARGET - _APP_OPENSSL_KEY_V1 @@ -585,6 +605,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_OPENSSL_KEY_V1 - _APP_DB_HOST - _APP_DB_PORT @@ -620,6 +642,8 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_CONNECTIONS_MAX + - _APP_POOL_CLIENTS - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER From c7f2785b45560427cb2e2b621c24459adf120be2 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 22 Nov 2022 21:07:04 +0530 Subject: [PATCH 33/76] feat: update worker counts --- .env | 2 +- app/init.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 6b31bc1620..cbc6ce1472 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ _APP_ENV=development _APP_LOCALE=en -_APP_WORKER_PER_CORE=6 +_APP_WORKER_PER_CORE=3 _APP_CONSOLE_WHITELIST_ROOT=disabled _APP_CONSOLE_WHITELIST_EMAILS= _APP_CONSOLE_WHITELIST_IPS= diff --git a/app/init.php b/app/init.php index 550dc6d744..6af338838d 100644 --- a/app/init.php +++ b/app/init.php @@ -552,10 +552,10 @@ $register->set('pools', function () { ], ]; - $maxConnections = App::getenv('_APP_CONNECTIONS_MAX', 151); - $instanceConnections = $maxConnections / App::getenv('_APP_POOL_CLIENTS', 14); + $maxConnections = App::getEnv('_APP_CONNECTIONS_MAX', 151); + $instanceConnections = $maxConnections / App::getEnv('_APP_POOL_CLIENTS', 14); - $multiprocessing = App::getenv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled'; + $multiprocessing = App::getEnv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled'; if ($multiprocessing) { $workerCount = swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6)); From 95ac8721f0894ca9d27cf8191208cc404b539545 Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Tue, 22 Nov 2022 16:50:41 +0100 Subject: [PATCH 34/76] Revert changes --- app/controllers/shared/api.php | 1 + app/workers/builds.php | 1 + app/workers/functions.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 324efa6109..db35cebc65 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -192,6 +192,7 @@ App::init() ->setUser($user); $usage + ->setParam('projectInternalId', $project->getInternalId()) ->setParam('projectId', $project->getId()) ->setParam('project.{scope}.network.requests', 1) ->setParam('httpMethod', $request->getMethod()) diff --git a/app/workers/builds.php b/app/workers/builds.php index 6b2cfcf66b..d26f07ab75 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -254,6 +254,7 @@ class BuildsV1 extends Worker $statsd = $register->get('statsd'); $usage = new Stats($statsd); $usage + ->setParam('projectInternalId', $project->getInternalId()) ->setParam('projectId', $project->getId()) ->setParam('functionId', $function->getId()) ->setParam('builds.{scope}.compute', 1) diff --git a/app/workers/functions.php b/app/workers/functions.php index a0c9bbdbac..2333cb315e 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -208,7 +208,8 @@ Server::setResource('execute', function () { $usage = new Stats($statsd); $usage ->setParam('projectId', $project->getId()) - ->setParam('functionId', $function->getId()) + ->setParam('projectInternalId', $project->getInternalId()) + ->setParam('functionId', $function->getId()) // TODO: We should use functionInternalId in usage stats ->setParam('executions.{scope}.compute', 1) ->setParam('executionStatus', $execution->getAttribute('status', '')) ->setParam('executionTime', $execution->getAttribute('duration')) From 92a59cdf3f2d96d8e2762ebb3a924a0d6509e148 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 22 Nov 2022 21:26:10 +0530 Subject: [PATCH 35/76] fix: use projectInternalId in the usage stats --- src/Appwrite/Usage/Calculators/TimeSeries.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Usage/Calculators/TimeSeries.php b/src/Appwrite/Usage/Calculators/TimeSeries.php index 145b40a402..ce92b6462f 100644 --- a/src/Appwrite/Usage/Calculators/TimeSeries.php +++ b/src/Appwrite/Usage/Calculators/TimeSeries.php @@ -489,7 +489,7 @@ class TimeSeries extends Calculator $query .= "WHERE \"time\" > '{$start}' "; $query .= "AND \"time\" < '{$end}' "; $query .= "AND \"metric_type\"='counter' {$filters} "; - $query .= "GROUP BY time({$period['key']}), \"projectId\" {$groupBy} "; + $query .= "GROUP BY time({$period['key']}), \"projectId\", \"projectInternalId\" {$groupBy} "; $query .= "FILL(null)"; try { @@ -516,7 +516,7 @@ class TimeSeries extends Calculator } $this->createOrUpdateMetric( - $point['projectId'], + $point['projectInternalId'], $point['time'], $period['key'], $metricUpdated, From d2b0218abaad0833ede62f82e398aead156b4d3b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 22 Nov 2022 18:26:41 +0000 Subject: [PATCH 36/76] feat: add build args for console --- Dockerfile | 3 +++ composer.lock | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f63ed3ddda..12ee4ddc70 100755 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,9 @@ COPY app/console /usr/local/src/console WORKDIR /usr/local/src/console +ARG VITE_GA_PROJECT="" +ENV VITE_GA_PROJECT=$VITE_GA_PROJECT + RUN npm ci RUN npm run build diff --git a/composer.lock b/composer.lock index 3b4148a950..e97546287f 100644 --- a/composer.lock +++ b/composer.lock @@ -3358,16 +3358,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.18", + "version": "9.2.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a" + "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a", - "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559", + "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559", "shasum": "" }, "require": { @@ -3423,7 +3423,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.18" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19" }, "funding": [ { @@ -3431,7 +3431,7 @@ "type": "github" } ], - "time": "2022-10-27T13:35:33+00:00" + "time": "2022-11-18T07:47:47+00:00" }, { "name": "phpunit/php-file-iterator", From fc752039a4ba035bff76da824bdc243ebd43882a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 23 Nov 2022 00:29:26 +0530 Subject: [PATCH 37/76] Update Dockerfile Co-authored-by: Torsten Dittmann --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 12ee4ddc70..5d36384140 100755 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ COPY app/console /usr/local/src/console WORKDIR /usr/local/src/console -ARG VITE_GA_PROJECT="" +ARG VITE_GA_PROJECT ENV VITE_GA_PROJECT=$VITE_GA_PROJECT RUN npm ci From 315eaaa562d91e7b25d0cd5b1f263d3fabbaad87 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 22 Nov 2022 19:19:43 +0000 Subject: [PATCH 38/76] Update examples for Swift, Kotlin, Web, Android and Apple --- .../java/account/create-anonymous-session.md | 56 ++++++++++++---- .../java/account/create-email-session.md | 63 ++++++++++++----- .../java/account/create-j-w-t.md | 56 ++++++++++++---- .../account/create-magic-u-r-l-session.md | 63 ++++++++++++----- .../java/account/create-o-auth2session.md | 59 +++++++++++----- .../java/account/create-phone-session.md | 63 ++++++++++++----- .../java/account/create-phone-verification.md | 56 ++++++++++++---- .../java/account/create-recovery.md | 63 ++++++++++++----- .../java/account/create-verification.md | 61 ++++++++++++----- .../client-android/java/account/create.md | 65 ++++++++++++------ .../java/account/delete-session.md | 61 ++++++++++++----- .../java/account/delete-sessions.md | 56 ++++++++++++---- .../client-android/java/account/get-prefs.md | 56 ++++++++++++---- .../java/account/get-session.md | 61 ++++++++++++----- .../1.1.x/client-android/java/account/get.md | 56 ++++++++++++---- .../client-android/java/account/list-logs.md | 59 +++++++++++----- .../java/account/list-sessions.md | 56 ++++++++++++---- .../java/account/update-email.md | 63 ++++++++++++----- .../account/update-magic-u-r-l-session.md | 63 ++++++++++++----- .../java/account/update-name.md | 61 ++++++++++++----- .../java/account/update-password.md | 61 ++++++++++++----- .../java/account/update-phone-session.md | 63 ++++++++++++----- .../java/account/update-phone-verification.md | 63 ++++++++++++----- .../java/account/update-phone.md | 63 ++++++++++++----- .../java/account/update-prefs.md | 61 ++++++++++++----- .../java/account/update-recovery.md | 67 +++++++++++++------ .../java/account/update-session.md | 61 ++++++++++++----- .../java/account/update-status.md | 56 ++++++++++++---- .../java/account/update-verification.md | 63 ++++++++++++----- .../java/avatars/get-browser.md | 61 ++++++++++++----- .../java/avatars/get-credit-card.md | 61 ++++++++++++----- .../java/avatars/get-favicon.md | 61 ++++++++++++----- .../client-android/java/avatars/get-flag.md | 61 ++++++++++++----- .../client-android/java/avatars/get-image.md | 61 ++++++++++++----- .../java/avatars/get-initials.md | 59 +++++++++++----- .../client-android/java/avatars/get-q-r.md | 61 ++++++++++++----- .../java/databases/create-document.md | 67 +++++++++++++------ .../java/databases/delete-document.md | 65 ++++++++++++------ .../java/databases/get-document.md | 65 ++++++++++++------ .../java/databases/list-documents.md | 63 ++++++++++++----- .../java/databases/update-document.md | 65 ++++++++++++------ .../java/functions/create-execution.md | 61 ++++++++++++----- .../java/functions/get-execution.md | 63 ++++++++++++----- .../java/functions/list-executions.md | 61 ++++++++++++----- .../1.1.x/client-android/java/locale/get.md | 56 ++++++++++++---- .../java/locale/list-continents.md | 56 ++++++++++++---- .../java/locale/list-countries-e-u.md | 56 ++++++++++++---- .../java/locale/list-countries-phones.md | 56 ++++++++++++---- .../java/locale/list-countries.md | 56 ++++++++++++---- .../java/locale/list-currencies.md | 56 ++++++++++++---- .../java/locale/list-languages.md | 56 ++++++++++++---- .../java/storage/create-file.md | 67 +++++++++++++------ .../java/storage/delete-file.md | 63 ++++++++++++----- .../java/storage/get-file-download.md | 63 ++++++++++++----- .../java/storage/get-file-preview.md | 63 ++++++++++++----- .../java/storage/get-file-view.md | 63 ++++++++++++----- .../client-android/java/storage/get-file.md | 63 ++++++++++++----- .../client-android/java/storage/list-files.md | 61 ++++++++++++----- .../java/storage/update-file.md | 63 ++++++++++++----- .../java/teams/create-membership.md | 67 +++++++++++++------ .../1.1.x/client-android/java/teams/create.md | 63 ++++++++++++----- .../java/teams/delete-membership.md | 63 ++++++++++++----- .../1.1.x/client-android/java/teams/delete.md | 61 ++++++++++++----- .../java/teams/get-membership.md | 63 ++++++++++++----- .../1.1.x/client-android/java/teams/get.md | 61 ++++++++++++----- .../java/teams/list-memberships.md | 61 ++++++++++++----- .../1.1.x/client-android/java/teams/list.md | 59 +++++++++++----- .../java/teams/update-membership-roles.md | 65 ++++++++++++------ .../java/teams/update-membership-status.md | 67 +++++++++++++------ .../1.1.x/client-android/java/teams/update.md | 63 ++++++++++++----- .../account/create-anonymous-session.md | 24 +++++-- .../kotlin/account/create-email-session.md | 30 ++++++--- .../kotlin/account/create-j-w-t.md | 24 +++++-- .../account/create-magic-u-r-l-session.md | 30 ++++++--- .../kotlin/account/create-o-auth2session.md | 29 ++++++-- .../kotlin/account/create-phone-session.md | 30 ++++++--- .../account/create-phone-verification.md | 24 +++++-- .../kotlin/account/create-recovery.md | 30 ++++++--- .../kotlin/account/create-verification.md | 28 ++++++-- .../client-android/kotlin/account/create.md | 32 ++++++--- .../kotlin/account/delete-session.md | 28 ++++++-- .../kotlin/account/delete-sessions.md | 24 +++++-- .../kotlin/account/get-prefs.md | 24 +++++-- .../kotlin/account/get-session.md | 28 ++++++-- .../client-android/kotlin/account/get.md | 24 +++++-- .../kotlin/account/list-logs.md | 26 +++++-- .../kotlin/account/list-sessions.md | 24 +++++-- .../kotlin/account/update-email.md | 30 ++++++--- .../account/update-magic-u-r-l-session.md | 30 ++++++--- .../kotlin/account/update-name.md | 28 ++++++-- .../kotlin/account/update-password.md | 28 ++++++-- .../kotlin/account/update-phone-session.md | 30 ++++++--- .../account/update-phone-verification.md | 30 ++++++--- .../kotlin/account/update-phone.md | 30 ++++++--- .../kotlin/account/update-prefs.md | 28 ++++++-- .../kotlin/account/update-recovery.md | 34 +++++++--- .../kotlin/account/update-session.md | 28 ++++++-- .../kotlin/account/update-status.md | 24 +++++-- .../kotlin/account/update-verification.md | 30 ++++++--- .../kotlin/avatars/get-browser.md | 28 ++++++-- .../kotlin/avatars/get-credit-card.md | 28 ++++++-- .../kotlin/avatars/get-favicon.md | 28 ++++++-- .../client-android/kotlin/avatars/get-flag.md | 28 ++++++-- .../kotlin/avatars/get-image.md | 28 ++++++-- .../kotlin/avatars/get-initials.md | 26 +++++-- .../client-android/kotlin/avatars/get-q-r.md | 28 ++++++-- .../kotlin/databases/create-document.md | 34 +++++++--- .../kotlin/databases/delete-document.md | 32 ++++++--- .../kotlin/databases/get-document.md | 32 ++++++--- .../kotlin/databases/list-documents.md | 30 ++++++--- .../kotlin/databases/update-document.md | 32 ++++++--- .../kotlin/functions/create-execution.md | 28 ++++++-- .../kotlin/functions/get-execution.md | 30 ++++++--- .../kotlin/functions/list-executions.md | 28 ++++++-- .../1.1.x/client-android/kotlin/locale/get.md | 24 +++++-- .../kotlin/locale/list-continents.md | 24 +++++-- .../kotlin/locale/list-countries-e-u.md | 24 +++++-- .../kotlin/locale/list-countries-phones.md | 24 +++++-- .../kotlin/locale/list-countries.md | 24 +++++-- .../kotlin/locale/list-currencies.md | 24 +++++-- .../kotlin/locale/list-languages.md | 24 +++++-- .../kotlin/storage/create-file.md | 32 ++++++--- .../kotlin/storage/delete-file.md | 30 ++++++--- .../kotlin/storage/get-file-download.md | 30 ++++++--- .../kotlin/storage/get-file-preview.md | 30 ++++++--- .../kotlin/storage/get-file-view.md | 30 ++++++--- .../client-android/kotlin/storage/get-file.md | 30 ++++++--- .../kotlin/storage/list-files.md | 28 ++++++-- .../kotlin/storage/update-file.md | 30 ++++++--- .../kotlin/teams/create-membership.md | 34 +++++++--- .../client-android/kotlin/teams/create.md | 30 ++++++--- .../kotlin/teams/delete-membership.md | 30 ++++++--- .../client-android/kotlin/teams/delete.md | 28 ++++++-- .../kotlin/teams/get-membership.md | 30 ++++++--- .../1.1.x/client-android/kotlin/teams/get.md | 28 ++++++-- .../kotlin/teams/list-memberships.md | 28 ++++++-- .../1.1.x/client-android/kotlin/teams/list.md | 26 +++++-- .../kotlin/teams/update-membership-roles.md | 32 ++++++--- .../kotlin/teams/update-membership-status.md | 34 +++++++--- .../client-android/kotlin/teams/update.md | 30 ++++++--- .../account/create-anonymous-session.md | 15 +++-- .../examples/account/create-email-session.md | 21 +++--- .../examples/account/create-j-w-t.md | 15 +++-- .../account/create-magic-u-r-l-session.md | 21 +++--- .../examples/account/create-o-auth2session.md | 19 +++--- .../examples/account/create-phone-session.md | 21 +++--- .../account/create-phone-verification.md | 15 +++-- .../examples/account/create-recovery.md | 21 +++--- .../examples/account/create-verification.md | 19 +++--- .../client-apple/examples/account/create.md | 23 ++++--- .../examples/account/delete-session.md | 19 +++--- .../examples/account/delete-sessions.md | 15 +++-- .../examples/account/get-prefs.md | 15 +++-- .../examples/account/get-session.md | 19 +++--- .../client-apple/examples/account/get.md | 15 +++-- .../examples/account/list-logs.md | 15 +++-- .../examples/account/list-sessions.md | 15 +++-- .../examples/account/update-email.md | 21 +++--- .../account/update-magic-u-r-l-session.md | 21 +++--- .../examples/account/update-name.md | 19 +++--- .../examples/account/update-password.md | 19 +++--- .../examples/account/update-phone-session.md | 21 +++--- .../account/update-phone-verification.md | 21 +++--- .../examples/account/update-phone.md | 21 +++--- .../examples/account/update-prefs.md | 19 +++--- .../examples/account/update-recovery.md | 25 +++---- .../examples/account/update-session.md | 19 +++--- .../examples/account/update-status.md | 15 +++-- .../examples/account/update-verification.md | 21 +++--- .../examples/avatars/get-browser.md | 19 +++--- .../examples/avatars/get-credit-card.md | 19 +++--- .../examples/avatars/get-favicon.md | 19 +++--- .../client-apple/examples/avatars/get-flag.md | 19 +++--- .../examples/avatars/get-image.md | 19 +++--- .../examples/avatars/get-initials.md | 15 +++-- .../client-apple/examples/avatars/get-q-r.md | 19 +++--- .../examples/databases/create-document.md | 25 +++---- .../examples/databases/delete-document.md | 23 ++++--- .../examples/databases/get-document.md | 23 ++++--- .../examples/databases/list-documents.md | 21 +++--- .../examples/databases/update-document.md | 23 ++++--- .../examples/functions/create-execution.md | 19 +++--- .../examples/functions/get-execution.md | 21 +++--- .../examples/functions/list-executions.md | 19 +++--- .../1.1.x/client-apple/examples/locale/get.md | 15 +++-- .../examples/locale/list-continents.md | 15 +++-- .../examples/locale/list-countries-e-u.md | 15 +++-- .../examples/locale/list-countries-phones.md | 15 +++-- .../examples/locale/list-countries.md | 15 +++-- .../examples/locale/list-currencies.md | 15 +++-- .../examples/locale/list-languages.md | 15 +++-- .../examples/storage/create-file.md | 23 ++++--- .../examples/storage/delete-file.md | 21 +++--- .../examples/storage/get-file-download.md | 21 +++--- .../examples/storage/get-file-preview.md | 21 +++--- .../examples/storage/get-file-view.md | 21 +++--- .../client-apple/examples/storage/get-file.md | 21 +++--- .../examples/storage/list-files.md | 19 +++--- .../examples/storage/update-file.md | 21 +++--- .../examples/teams/create-membership.md | 25 +++---- .../client-apple/examples/teams/create.md | 21 +++--- .../examples/teams/delete-membership.md | 21 +++--- .../client-apple/examples/teams/delete.md | 19 +++--- .../examples/teams/get-membership.md | 21 +++--- .../1.1.x/client-apple/examples/teams/get.md | 19 +++--- .../examples/teams/list-memberships.md | 19 +++--- .../1.1.x/client-apple/examples/teams/list.md | 15 +++-- .../examples/teams/update-membership-roles.md | 23 ++++--- .../teams/update-membership-status.md | 25 +++---- .../client-apple/examples/teams/update.md | 21 +++--- .../account/create-anonymous-session.md | 2 +- .../examples/account/create-email-session.md | 2 +- .../examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-session.md | 2 +- .../examples/account/create-o-auth2session.md | 2 +- .../examples/account/create-phone-session.md | 2 +- .../account/create-phone-verification.md | 2 +- .../examples/account/create-recovery.md | 2 +- .../examples/account/create-verification.md | 2 +- .../client-web/examples/account/create.md | 2 +- .../examples/account/delete-session.md | 2 +- .../examples/account/delete-sessions.md | 2 +- .../client-web/examples/account/get-prefs.md | 2 +- .../examples/account/get-session.md | 2 +- .../1.1.x/client-web/examples/account/get.md | 2 +- .../client-web/examples/account/list-logs.md | 2 +- .../examples/account/list-sessions.md | 2 +- .../examples/account/update-email.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../examples/account/update-name.md | 2 +- .../examples/account/update-password.md | 2 +- .../examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- .../examples/account/update-phone.md | 2 +- .../examples/account/update-prefs.md | 2 +- .../examples/account/update-recovery.md | 2 +- .../examples/account/update-session.md | 2 +- .../examples/account/update-status.md | 2 +- .../examples/account/update-verification.md | 2 +- .../examples/avatars/get-browser.md | 2 +- .../examples/avatars/get-credit-card.md | 2 +- .../examples/avatars/get-favicon.md | 2 +- .../client-web/examples/avatars/get-flag.md | 2 +- .../client-web/examples/avatars/get-image.md | 2 +- .../examples/avatars/get-initials.md | 2 +- .../client-web/examples/avatars/get-q-r.md | 2 +- .../examples/databases/create-document.md | 2 +- .../examples/databases/delete-document.md | 2 +- .../examples/databases/get-document.md | 2 +- .../examples/databases/list-documents.md | 2 +- .../examples/databases/update-document.md | 2 +- .../examples/functions/create-execution.md | 2 +- .../examples/functions/get-execution.md | 2 +- .../examples/functions/list-executions.md | 2 +- .../1.1.x/client-web/examples/locale/get.md | 2 +- .../examples/locale/list-continents.md | 2 +- .../examples/locale/list-countries-e-u.md | 2 +- .../examples/locale/list-countries-phones.md | 2 +- .../examples/locale/list-countries.md | 2 +- .../examples/locale/list-currencies.md | 2 +- .../examples/locale/list-languages.md | 2 +- .../examples/storage/create-file.md | 2 +- .../examples/storage/delete-file.md | 2 +- .../examples/storage/get-file-download.md | 2 +- .../examples/storage/get-file-preview.md | 2 +- .../examples/storage/get-file-view.md | 2 +- .../client-web/examples/storage/get-file.md | 2 +- .../client-web/examples/storage/list-files.md | 2 +- .../examples/storage/update-file.md | 2 +- .../examples/teams/create-membership.md | 2 +- .../1.1.x/client-web/examples/teams/create.md | 2 +- .../examples/teams/delete-membership.md | 2 +- .../1.1.x/client-web/examples/teams/delete.md | 2 +- .../examples/teams/get-membership.md | 2 +- .../1.1.x/client-web/examples/teams/get.md | 2 +- .../examples/teams/list-memberships.md | 2 +- .../1.1.x/client-web/examples/teams/list.md | 2 +- .../examples/teams/update-membership-roles.md | 2 +- .../teams/update-membership-status.md | 2 +- .../1.1.x/client-web/examples/teams/update.md | 2 +- .../account/create-anonymous-session.md | 2 +- .../examples/account/create-email-session.md | 2 +- .../examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-session.md | 2 +- .../examples/account/create-o-auth2session.md | 2 +- .../examples/account/create-phone-session.md | 2 +- .../account/create-phone-verification.md | 2 +- .../examples/account/create-recovery.md | 2 +- .../examples/account/create-verification.md | 2 +- .../console-web/examples/account/create.md | 2 +- .../examples/account/delete-session.md | 2 +- .../examples/account/delete-sessions.md | 2 +- .../console-web/examples/account/get-prefs.md | 2 +- .../examples/account/get-session.md | 2 +- .../1.1.x/console-web/examples/account/get.md | 2 +- .../console-web/examples/account/list-logs.md | 2 +- .../examples/account/list-sessions.md | 2 +- .../examples/account/update-email.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../examples/account/update-name.md | 2 +- .../examples/account/update-password.md | 2 +- .../examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- .../examples/account/update-phone.md | 2 +- .../examples/account/update-prefs.md | 2 +- .../examples/account/update-recovery.md | 2 +- .../examples/account/update-session.md | 2 +- .../examples/account/update-status.md | 2 +- .../examples/account/update-verification.md | 2 +- .../examples/avatars/get-browser.md | 2 +- .../examples/avatars/get-credit-card.md | 2 +- .../examples/avatars/get-favicon.md | 2 +- .../console-web/examples/avatars/get-flag.md | 2 +- .../console-web/examples/avatars/get-image.md | 2 +- .../examples/avatars/get-initials.md | 2 +- .../console-web/examples/avatars/get-q-r.md | 2 +- .../databases/create-boolean-attribute.md | 2 +- .../examples/databases/create-collection.md | 2 +- .../databases/create-datetime-attribute.md | 2 +- .../examples/databases/create-document.md | 2 +- .../databases/create-email-attribute.md | 2 +- .../databases/create-enum-attribute.md | 2 +- .../databases/create-float-attribute.md | 2 +- .../examples/databases/create-index.md | 2 +- .../databases/create-integer-attribute.md | 2 +- .../examples/databases/create-ip-attribute.md | 2 +- .../databases/create-string-attribute.md | 2 +- .../databases/create-url-attribute.md | 2 +- .../console-web/examples/databases/create.md | 2 +- .../examples/databases/delete-attribute.md | 2 +- .../examples/databases/delete-collection.md | 2 +- .../examples/databases/delete-document.md | 2 +- .../examples/databases/delete-index.md | 2 +- .../console-web/examples/databases/delete.md | 2 +- .../examples/databases/get-attribute.md | 2 +- .../databases/get-collection-usage.md | 2 +- .../examples/databases/get-collection.md | 2 +- .../examples/databases/get-database-usage.md | 2 +- .../examples/databases/get-document.md | 2 +- .../examples/databases/get-index.md | 2 +- .../examples/databases/get-usage.md | 2 +- .../console-web/examples/databases/get.md | 2 +- .../examples/databases/list-attributes.md | 2 +- .../databases/list-collection-logs.md | 2 +- .../examples/databases/list-collections.md | 2 +- .../examples/databases/list-document-logs.md | 2 +- .../examples/databases/list-documents.md | 2 +- .../examples/databases/list-indexes.md | 2 +- .../examples/databases/list-logs.md | 2 +- .../console-web/examples/databases/list.md | 2 +- .../examples/databases/update-collection.md | 2 +- .../examples/databases/update-document.md | 2 +- .../console-web/examples/databases/update.md | 2 +- .../examples/functions/create-build.md | 2 +- .../examples/functions/create-deployment.md | 2 +- .../examples/functions/create-execution.md | 2 +- .../examples/functions/create-variable.md | 2 +- .../console-web/examples/functions/create.md | 2 +- .../examples/functions/delete-deployment.md | 2 +- .../examples/functions/delete-variable.md | 2 +- .../console-web/examples/functions/delete.md | 2 +- .../examples/functions/get-deployment.md | 2 +- .../examples/functions/get-execution.md | 2 +- .../examples/functions/get-function-usage.md | 2 +- .../examples/functions/get-usage.md | 2 +- .../examples/functions/get-variable.md | 2 +- .../console-web/examples/functions/get.md | 2 +- .../examples/functions/list-deployments.md | 2 +- .../examples/functions/list-executions.md | 2 +- .../examples/functions/list-runtimes.md | 2 +- .../examples/functions/list-variables.md | 2 +- .../console-web/examples/functions/list.md | 2 +- .../examples/functions/update-deployment.md | 2 +- .../examples/functions/update-variable.md | 2 +- .../console-web/examples/functions/update.md | 2 +- .../examples/health/get-antivirus.md | 2 +- .../console-web/examples/health/get-cache.md | 2 +- .../console-web/examples/health/get-d-b.md | 2 +- .../examples/health/get-queue-certificates.md | 2 +- .../examples/health/get-queue-functions.md | 2 +- .../examples/health/get-queue-logs.md | 2 +- .../examples/health/get-queue-webhooks.md | 2 +- .../examples/health/get-storage-local.md | 2 +- .../console-web/examples/health/get-time.md | 2 +- .../1.1.x/console-web/examples/health/get.md | 2 +- .../1.1.x/console-web/examples/locale/get.md | 2 +- .../examples/locale/list-continents.md | 2 +- .../examples/locale/list-countries-e-u.md | 2 +- .../examples/locale/list-countries-phones.md | 2 +- .../examples/locale/list-countries.md | 2 +- .../examples/locale/list-currencies.md | 2 +- .../examples/locale/list-languages.md | 2 +- .../examples/projects/create-domain.md | 2 +- .../examples/projects/create-key.md | 2 +- .../examples/projects/create-platform.md | 2 +- .../examples/projects/create-webhook.md | 2 +- .../console-web/examples/projects/create.md | 2 +- .../examples/projects/delete-domain.md | 2 +- .../examples/projects/delete-key.md | 2 +- .../examples/projects/delete-platform.md | 2 +- .../examples/projects/delete-webhook.md | 2 +- .../console-web/examples/projects/delete.md | 2 +- .../examples/projects/get-domain.md | 2 +- .../console-web/examples/projects/get-key.md | 2 +- .../examples/projects/get-platform.md | 2 +- .../examples/projects/get-usage.md | 2 +- .../examples/projects/get-webhook.md | 2 +- .../console-web/examples/projects/get.md | 2 +- .../examples/projects/list-domains.md | 2 +- .../examples/projects/list-keys.md | 2 +- .../examples/projects/list-platforms.md | 2 +- .../examples/projects/list-webhooks.md | 2 +- .../console-web/examples/projects/list.md | 2 +- .../examples/projects/update-auth-duration.md | 2 +- .../examples/projects/update-auth-limit.md | 2 +- .../examples/projects/update-auth-status.md | 2 +- .../projects/update-domain-verification.md | 2 +- .../examples/projects/update-key.md | 2 +- .../examples/projects/update-o-auth2.md | 2 +- .../examples/projects/update-platform.md | 2 +- .../projects/update-service-status.md | 2 +- .../projects/update-webhook-signature.md | 2 +- .../examples/projects/update-webhook.md | 2 +- .../console-web/examples/projects/update.md | 2 +- .../examples/storage/create-bucket.md | 2 +- .../examples/storage/create-file.md | 2 +- .../examples/storage/delete-bucket.md | 2 +- .../examples/storage/delete-file.md | 2 +- .../examples/storage/get-bucket-usage.md | 2 +- .../examples/storage/get-bucket.md | 2 +- .../examples/storage/get-file-download.md | 2 +- .../examples/storage/get-file-preview.md | 2 +- .../examples/storage/get-file-view.md | 2 +- .../console-web/examples/storage/get-file.md | 2 +- .../console-web/examples/storage/get-usage.md | 2 +- .../examples/storage/list-buckets.md | 2 +- .../examples/storage/list-files.md | 2 +- .../examples/storage/update-bucket.md | 2 +- .../examples/storage/update-file.md | 2 +- .../examples/teams/create-membership.md | 2 +- .../console-web/examples/teams/create.md | 2 +- .../examples/teams/delete-membership.md | 2 +- .../console-web/examples/teams/delete.md | 2 +- .../examples/teams/get-membership.md | 2 +- .../1.1.x/console-web/examples/teams/get.md | 2 +- .../console-web/examples/teams/list-logs.md | 2 +- .../examples/teams/list-memberships.md | 2 +- .../1.1.x/console-web/examples/teams/list.md | 2 +- .../examples/teams/update-membership-roles.md | 2 +- .../teams/update-membership-status.md | 2 +- .../console-web/examples/teams/update.md | 2 +- .../examples/users/create-argon2user.md | 2 +- .../examples/users/create-bcrypt-user.md | 2 +- .../examples/users/create-m-d5user.md | 2 +- .../examples/users/create-p-h-pass-user.md | 2 +- .../examples/users/create-s-h-a-user.md | 2 +- .../users/create-scrypt-modified-user.md | 2 +- .../examples/users/create-scrypt-user.md | 2 +- .../console-web/examples/users/create.md | 2 +- .../examples/users/delete-session.md | 2 +- .../examples/users/delete-sessions.md | 2 +- .../console-web/examples/users/delete.md | 2 +- .../console-web/examples/users/get-prefs.md | 2 +- .../console-web/examples/users/get-usage.md | 2 +- .../1.1.x/console-web/examples/users/get.md | 2 +- .../console-web/examples/users/list-logs.md | 2 +- .../examples/users/list-memberships.md | 2 +- .../examples/users/list-sessions.md | 2 +- .../1.1.x/console-web/examples/users/list.md | 2 +- .../users/update-email-verification.md | 2 +- .../examples/users/update-email.md | 2 +- .../console-web/examples/users/update-name.md | 2 +- .../examples/users/update-password.md | 2 +- .../users/update-phone-verification.md | 2 +- .../examples/users/update-phone.md | 2 +- .../examples/users/update-prefs.md | 2 +- .../examples/users/update-status.md | 2 +- .../java/account/create-phone-verification.md | 46 ++++++++----- .../java/account/create-recovery.md | 52 ++++++++------ .../java/account/create-verification.md | 50 +++++++++----- .../java/account/delete-session.md | 50 +++++++++----- .../java/account/delete-sessions.md | 46 ++++++++----- .../server-kotlin/java/account/get-prefs.md | 46 ++++++++----- .../server-kotlin/java/account/get-session.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/account/get.md | 46 ++++++++----- .../server-kotlin/java/account/list-logs.md | 48 ++++++++----- .../java/account/list-sessions.md | 46 ++++++++----- .../java/account/update-email.md | 52 ++++++++------ .../server-kotlin/java/account/update-name.md | 50 +++++++++----- .../java/account/update-password.md | 50 +++++++++----- .../java/account/update-phone-verification.md | 52 ++++++++------ .../java/account/update-phone.md | 52 ++++++++------ .../java/account/update-prefs.md | 50 +++++++++----- .../java/account/update-recovery.md | 56 ++++++++++------ .../java/account/update-session.md | 50 +++++++++----- .../java/account/update-status.md | 46 ++++++++----- .../java/account/update-verification.md | 52 ++++++++------ .../server-kotlin/java/avatars/get-browser.md | 50 +++++++++----- .../java/avatars/get-credit-card.md | 50 +++++++++----- .../server-kotlin/java/avatars/get-favicon.md | 50 +++++++++----- .../server-kotlin/java/avatars/get-flag.md | 50 +++++++++----- .../server-kotlin/java/avatars/get-image.md | 50 +++++++++----- .../java/avatars/get-initials.md | 48 ++++++++----- .../server-kotlin/java/avatars/get-q-r.md | 50 +++++++++----- .../databases/create-boolean-attribute.md | 56 ++++++++++------ .../java/databases/create-collection.md | 54 +++++++++------ .../databases/create-datetime-attribute.md | 56 ++++++++++------ .../java/databases/create-document.md | 56 ++++++++++------ .../java/databases/create-email-attribute.md | 56 ++++++++++------ .../java/databases/create-enum-attribute.md | 58 ++++++++++------ .../java/databases/create-float-attribute.md | 56 ++++++++++------ .../java/databases/create-index.md | 58 ++++++++++------ .../databases/create-integer-attribute.md | 56 ++++++++++------ .../java/databases/create-ip-attribute.md | 56 ++++++++++------ .../java/databases/create-string-attribute.md | 58 ++++++++++------ .../java/databases/create-url-attribute.md | 56 ++++++++++------ .../server-kotlin/java/databases/create.md | 52 ++++++++------ .../java/databases/delete-attribute.md | 54 +++++++++------ .../java/databases/delete-collection.md | 52 ++++++++------ .../java/databases/delete-document.md | 54 +++++++++------ .../java/databases/delete-index.md | 54 +++++++++------ .../server-kotlin/java/databases/delete.md | 50 +++++++++----- .../java/databases/get-attribute.md | 54 +++++++++------ .../java/databases/get-collection.md | 52 ++++++++------ .../java/databases/get-document.md | 54 +++++++++------ .../server-kotlin/java/databases/get-index.md | 54 +++++++++------ .../1.1.x/server-kotlin/java/databases/get.md | 50 +++++++++----- .../java/databases/list-attributes.md | 52 ++++++++------ .../java/databases/list-collections.md | 50 +++++++++----- .../java/databases/list-documents.md | 52 ++++++++------ .../java/databases/list-indexes.md | 52 ++++++++------ .../server-kotlin/java/databases/list.md | 48 ++++++++----- .../java/databases/update-collection.md | 54 +++++++++------ .../java/databases/update-document.md | 54 +++++++++------ .../server-kotlin/java/databases/update.md | 52 ++++++++------ .../java/functions/create-build.md | 54 +++++++++------ .../java/functions/create-deployment.md | 58 ++++++++++------ .../java/functions/create-execution.md | 50 +++++++++----- .../java/functions/create-variable.md | 54 +++++++++------ .../server-kotlin/java/functions/create.md | 56 ++++++++++------ .../java/functions/delete-deployment.md | 52 ++++++++------ .../java/functions/delete-variable.md | 52 ++++++++------ .../server-kotlin/java/functions/delete.md | 50 +++++++++----- .../java/functions/get-deployment.md | 52 ++++++++------ .../java/functions/get-execution.md | 52 ++++++++------ .../java/functions/get-variable.md | 52 ++++++++------ .../1.1.x/server-kotlin/java/functions/get.md | 50 +++++++++----- .../java/functions/list-deployments.md | 50 +++++++++----- .../java/functions/list-executions.md | 50 +++++++++----- .../java/functions/list-runtimes.md | 46 ++++++++----- .../java/functions/list-variables.md | 50 +++++++++----- .../server-kotlin/java/functions/list.md | 48 ++++++++----- .../java/functions/update-deployment.md | 52 ++++++++------ .../java/functions/update-variable.md | 54 +++++++++------ .../server-kotlin/java/functions/update.md | 54 +++++++++------ .../java/health/get-antivirus.md | 46 ++++++++----- .../server-kotlin/java/health/get-cache.md | 46 ++++++++----- .../server-kotlin/java/health/get-d-b.md | 46 ++++++++----- .../java/health/get-queue-certificates.md | 46 ++++++++----- .../java/health/get-queue-functions.md | 46 ++++++++----- .../java/health/get-queue-logs.md | 46 ++++++++----- .../java/health/get-queue-webhooks.md | 46 ++++++++----- .../java/health/get-storage-local.md | 46 ++++++++----- .../server-kotlin/java/health/get-time.md | 46 ++++++++----- .../1.1.x/server-kotlin/java/health/get.md | 46 ++++++++----- .../1.1.x/server-kotlin/java/locale/get.md | 46 ++++++++----- .../java/locale/list-continents.md | 46 ++++++++----- .../java/locale/list-countries-e-u.md | 46 ++++++++----- .../java/locale/list-countries-phones.md | 46 ++++++++----- .../java/locale/list-countries.md | 46 ++++++++----- .../java/locale/list-currencies.md | 46 ++++++++----- .../java/locale/list-languages.md | 46 ++++++++----- .../java/storage/create-bucket.md | 52 ++++++++------ .../server-kotlin/java/storage/create-file.md | 56 ++++++++++------ .../java/storage/delete-bucket.md | 50 +++++++++----- .../server-kotlin/java/storage/delete-file.md | 52 ++++++++------ .../server-kotlin/java/storage/get-bucket.md | 50 +++++++++----- .../java/storage/get-file-download.md | 52 ++++++++------ .../java/storage/get-file-preview.md | 52 ++++++++------ .../java/storage/get-file-view.md | 52 ++++++++------ .../server-kotlin/java/storage/get-file.md | 52 ++++++++------ .../java/storage/list-buckets.md | 48 ++++++++----- .../server-kotlin/java/storage/list-files.md | 50 +++++++++----- .../java/storage/update-bucket.md | 52 ++++++++------ .../server-kotlin/java/storage/update-file.md | 52 ++++++++------ .../java/teams/create-membership.md | 56 ++++++++++------ .../1.1.x/server-kotlin/java/teams/create.md | 52 ++++++++------ .../java/teams/delete-membership.md | 52 ++++++++------ .../1.1.x/server-kotlin/java/teams/delete.md | 50 +++++++++----- .../java/teams/get-membership.md | 52 ++++++++------ .../1.1.x/server-kotlin/java/teams/get.md | 50 +++++++++----- .../java/teams/list-memberships.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/teams/list.md | 48 ++++++++----- .../java/teams/update-membership-roles.md | 54 +++++++++------ .../java/teams/update-membership-status.md | 56 ++++++++++------ .../1.1.x/server-kotlin/java/teams/update.md | 52 ++++++++------ .../java/users/create-argon2user.md | 54 +++++++++------ .../java/users/create-bcrypt-user.md | 54 +++++++++------ .../java/users/create-m-d5user.md | 54 +++++++++------ .../java/users/create-p-h-pass-user.md | 54 +++++++++------ .../java/users/create-s-h-a-user.md | 54 +++++++++------ .../java/users/create-scrypt-modified-user.md | 60 ++++++++++------- .../java/users/create-scrypt-user.md | 64 +++++++++++------- .../1.1.x/server-kotlin/java/users/create.md | 50 +++++++++----- .../java/users/delete-session.md | 52 ++++++++------ .../java/users/delete-sessions.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/users/delete.md | 50 +++++++++----- .../server-kotlin/java/users/get-prefs.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/users/get.md | 50 +++++++++----- .../server-kotlin/java/users/list-logs.md | 50 +++++++++----- .../java/users/list-memberships.md | 50 +++++++++----- .../server-kotlin/java/users/list-sessions.md | 50 +++++++++----- .../1.1.x/server-kotlin/java/users/list.md | 48 ++++++++----- .../java/users/update-email-verification.md | 52 ++++++++------ .../server-kotlin/java/users/update-email.md | 52 ++++++++------ .../server-kotlin/java/users/update-name.md | 52 ++++++++------ .../java/users/update-password.md | 52 ++++++++------ .../java/users/update-phone-verification.md | 52 ++++++++------ .../server-kotlin/java/users/update-phone.md | 52 ++++++++------ .../server-kotlin/java/users/update-prefs.md | 52 ++++++++------ .../server-kotlin/java/users/update-status.md | 52 ++++++++------ .../account/create-phone-verification.md | 16 +++-- .../kotlin/account/create-recovery.md | 22 +++--- .../kotlin/account/create-verification.md | 20 +++--- .../kotlin/account/delete-session.md | 20 +++--- .../kotlin/account/delete-sessions.md | 16 +++-- .../server-kotlin/kotlin/account/get-prefs.md | 16 +++-- .../kotlin/account/get-session.md | 20 +++--- .../1.1.x/server-kotlin/kotlin/account/get.md | 16 +++-- .../server-kotlin/kotlin/account/list-logs.md | 18 ++--- .../kotlin/account/list-sessions.md | 16 +++-- .../kotlin/account/update-email.md | 22 +++--- .../kotlin/account/update-name.md | 20 +++--- .../kotlin/account/update-password.md | 20 +++--- .../account/update-phone-verification.md | 22 +++--- .../kotlin/account/update-phone.md | 22 +++--- .../kotlin/account/update-prefs.md | 20 +++--- .../kotlin/account/update-recovery.md | 26 +++---- .../kotlin/account/update-session.md | 20 +++--- .../kotlin/account/update-status.md | 16 +++-- .../kotlin/account/update-verification.md | 22 +++--- .../kotlin/avatars/get-browser.md | 20 +++--- .../kotlin/avatars/get-credit-card.md | 20 +++--- .../kotlin/avatars/get-favicon.md | 20 +++--- .../server-kotlin/kotlin/avatars/get-flag.md | 20 +++--- .../server-kotlin/kotlin/avatars/get-image.md | 20 +++--- .../kotlin/avatars/get-initials.md | 18 ++--- .../server-kotlin/kotlin/avatars/get-q-r.md | 20 +++--- .../databases/create-boolean-attribute.md | 26 +++---- .../kotlin/databases/create-collection.md | 24 ++++--- .../databases/create-datetime-attribute.md | 26 +++---- .../kotlin/databases/create-document.md | 26 +++---- .../databases/create-email-attribute.md | 26 +++---- .../kotlin/databases/create-enum-attribute.md | 28 ++++---- .../databases/create-float-attribute.md | 26 +++---- .../kotlin/databases/create-index.md | 28 ++++---- .../databases/create-integer-attribute.md | 26 +++---- .../kotlin/databases/create-ip-attribute.md | 26 +++---- .../databases/create-string-attribute.md | 28 ++++---- .../kotlin/databases/create-url-attribute.md | 26 +++---- .../server-kotlin/kotlin/databases/create.md | 22 +++--- .../kotlin/databases/delete-attribute.md | 24 ++++--- .../kotlin/databases/delete-collection.md | 22 +++--- .../kotlin/databases/delete-document.md | 24 ++++--- .../kotlin/databases/delete-index.md | 24 ++++--- .../server-kotlin/kotlin/databases/delete.md | 20 +++--- .../kotlin/databases/get-attribute.md | 24 ++++--- .../kotlin/databases/get-collection.md | 22 +++--- .../kotlin/databases/get-document.md | 24 ++++--- .../kotlin/databases/get-index.md | 24 ++++--- .../server-kotlin/kotlin/databases/get.md | 20 +++--- .../kotlin/databases/list-attributes.md | 22 +++--- .../kotlin/databases/list-collections.md | 20 +++--- .../kotlin/databases/list-documents.md | 22 +++--- .../kotlin/databases/list-indexes.md | 22 +++--- .../server-kotlin/kotlin/databases/list.md | 18 ++--- .../kotlin/databases/update-collection.md | 24 ++++--- .../kotlin/databases/update-document.md | 24 ++++--- .../server-kotlin/kotlin/databases/update.md | 22 +++--- .../kotlin/functions/create-build.md | 24 ++++--- .../kotlin/functions/create-deployment.md | 26 +++---- .../kotlin/functions/create-execution.md | 20 +++--- .../kotlin/functions/create-variable.md | 24 ++++--- .../server-kotlin/kotlin/functions/create.md | 26 +++---- .../kotlin/functions/delete-deployment.md | 22 +++--- .../kotlin/functions/delete-variable.md | 22 +++--- .../server-kotlin/kotlin/functions/delete.md | 20 +++--- .../kotlin/functions/get-deployment.md | 22 +++--- .../kotlin/functions/get-execution.md | 22 +++--- .../kotlin/functions/get-variable.md | 22 +++--- .../server-kotlin/kotlin/functions/get.md | 20 +++--- .../kotlin/functions/list-deployments.md | 20 +++--- .../kotlin/functions/list-executions.md | 20 +++--- .../kotlin/functions/list-runtimes.md | 16 +++-- .../kotlin/functions/list-variables.md | 20 +++--- .../server-kotlin/kotlin/functions/list.md | 18 ++--- .../kotlin/functions/update-deployment.md | 22 +++--- .../kotlin/functions/update-variable.md | 24 ++++--- .../server-kotlin/kotlin/functions/update.md | 24 ++++--- .../kotlin/health/get-antivirus.md | 16 +++-- .../server-kotlin/kotlin/health/get-cache.md | 16 +++-- .../server-kotlin/kotlin/health/get-d-b.md | 16 +++-- .../kotlin/health/get-queue-certificates.md | 16 +++-- .../kotlin/health/get-queue-functions.md | 16 +++-- .../kotlin/health/get-queue-logs.md | 16 +++-- .../kotlin/health/get-queue-webhooks.md | 16 +++-- .../kotlin/health/get-storage-local.md | 16 +++-- .../server-kotlin/kotlin/health/get-time.md | 16 +++-- .../1.1.x/server-kotlin/kotlin/health/get.md | 16 +++-- .../1.1.x/server-kotlin/kotlin/locale/get.md | 16 +++-- .../kotlin/locale/list-continents.md | 16 +++-- .../kotlin/locale/list-countries-e-u.md | 16 +++-- .../kotlin/locale/list-countries-phones.md | 16 +++-- .../kotlin/locale/list-countries.md | 16 +++-- .../kotlin/locale/list-currencies.md | 16 +++-- .../kotlin/locale/list-languages.md | 16 +++-- .../kotlin/storage/create-bucket.md | 22 +++--- .../kotlin/storage/create-file.md | 24 ++++--- .../kotlin/storage/delete-bucket.md | 20 +++--- .../kotlin/storage/delete-file.md | 22 +++--- .../kotlin/storage/get-bucket.md | 20 +++--- .../kotlin/storage/get-file-download.md | 22 +++--- .../kotlin/storage/get-file-preview.md | 22 +++--- .../kotlin/storage/get-file-view.md | 22 +++--- .../server-kotlin/kotlin/storage/get-file.md | 22 +++--- .../kotlin/storage/list-buckets.md | 18 ++--- .../kotlin/storage/list-files.md | 20 +++--- .../kotlin/storage/update-bucket.md | 22 +++--- .../kotlin/storage/update-file.md | 22 +++--- .../kotlin/teams/create-membership.md | 26 +++---- .../server-kotlin/kotlin/teams/create.md | 22 +++--- .../kotlin/teams/delete-membership.md | 22 +++--- .../server-kotlin/kotlin/teams/delete.md | 20 +++--- .../kotlin/teams/get-membership.md | 22 +++--- .../1.1.x/server-kotlin/kotlin/teams/get.md | 20 +++--- .../kotlin/teams/list-memberships.md | 20 +++--- .../1.1.x/server-kotlin/kotlin/teams/list.md | 18 ++--- .../kotlin/teams/update-membership-roles.md | 24 ++++--- .../kotlin/teams/update-membership-status.md | 26 +++---- .../server-kotlin/kotlin/teams/update.md | 22 +++--- .../kotlin/users/create-argon2user.md | 24 ++++--- .../kotlin/users/create-bcrypt-user.md | 24 ++++--- .../kotlin/users/create-m-d5user.md | 24 ++++--- .../kotlin/users/create-p-h-pass-user.md | 24 ++++--- .../kotlin/users/create-s-h-a-user.md | 24 ++++--- .../users/create-scrypt-modified-user.md | 30 +++++---- .../kotlin/users/create-scrypt-user.md | 34 +++++----- .../server-kotlin/kotlin/users/create.md | 20 +++--- .../kotlin/users/delete-session.md | 22 +++--- .../kotlin/users/delete-sessions.md | 20 +++--- .../server-kotlin/kotlin/users/delete.md | 20 +++--- .../server-kotlin/kotlin/users/get-prefs.md | 20 +++--- .../1.1.x/server-kotlin/kotlin/users/get.md | 20 +++--- .../server-kotlin/kotlin/users/list-logs.md | 20 +++--- .../kotlin/users/list-memberships.md | 20 +++--- .../kotlin/users/list-sessions.md | 20 +++--- .../1.1.x/server-kotlin/kotlin/users/list.md | 18 ++--- .../kotlin/users/update-email-verification.md | 22 +++--- .../kotlin/users/update-email.md | 22 +++--- .../server-kotlin/kotlin/users/update-name.md | 22 +++--- .../kotlin/users/update-password.md | 22 +++--- .../kotlin/users/update-phone-verification.md | 22 +++--- .../kotlin/users/update-phone.md | 22 +++--- .../kotlin/users/update-prefs.md | 22 +++--- .../kotlin/users/update-status.md | 22 +++--- .../account/create-phone-verification.md | 17 ++--- .../examples/account/create-recovery.md | 23 ++++--- .../examples/account/create-verification.md | 21 +++--- .../examples/account/delete-session.md | 21 +++--- .../examples/account/delete-sessions.md | 17 ++--- .../examples/account/get-prefs.md | 17 ++--- .../examples/account/get-session.md | 21 +++--- .../server-swift/examples/account/get.md | 17 ++--- .../examples/account/list-logs.md | 17 ++--- .../examples/account/list-sessions.md | 17 ++--- .../examples/account/update-email.md | 23 ++++--- .../examples/account/update-name.md | 21 +++--- .../examples/account/update-password.md | 21 +++--- .../account/update-phone-verification.md | 23 ++++--- .../examples/account/update-phone.md | 23 ++++--- .../examples/account/update-prefs.md | 21 +++--- .../examples/account/update-recovery.md | 27 ++++---- .../examples/account/update-session.md | 21 +++--- .../examples/account/update-status.md | 17 ++--- .../examples/account/update-verification.md | 23 ++++--- .../examples/avatars/get-browser.md | 21 +++--- .../examples/avatars/get-credit-card.md | 21 +++--- .../examples/avatars/get-favicon.md | 21 +++--- .../server-swift/examples/avatars/get-flag.md | 21 +++--- .../examples/avatars/get-image.md | 21 +++--- .../examples/avatars/get-initials.md | 17 ++--- .../server-swift/examples/avatars/get-q-r.md | 21 +++--- .../databases/create-boolean-attribute.md | 27 ++++---- .../examples/databases/create-collection.md | 25 +++---- .../databases/create-datetime-attribute.md | 27 ++++---- .../examples/databases/create-document.md | 27 ++++---- .../databases/create-email-attribute.md | 27 ++++---- .../databases/create-enum-attribute.md | 29 ++++---- .../databases/create-float-attribute.md | 27 ++++---- .../examples/databases/create-index.md | 29 ++++---- .../databases/create-integer-attribute.md | 27 ++++---- .../examples/databases/create-ip-attribute.md | 27 ++++---- .../databases/create-string-attribute.md | 29 ++++---- .../databases/create-url-attribute.md | 27 ++++---- .../server-swift/examples/databases/create.md | 23 ++++--- .../examples/databases/delete-attribute.md | 25 +++---- .../examples/databases/delete-collection.md | 23 ++++--- .../examples/databases/delete-document.md | 25 +++---- .../examples/databases/delete-index.md | 25 +++---- .../server-swift/examples/databases/delete.md | 21 +++--- .../examples/databases/get-attribute.md | 25 +++---- .../examples/databases/get-collection.md | 23 ++++--- .../examples/databases/get-document.md | 25 +++---- .../examples/databases/get-index.md | 25 +++---- .../server-swift/examples/databases/get.md | 21 +++--- .../examples/databases/list-attributes.md | 23 ++++--- .../examples/databases/list-collections.md | 21 +++--- .../examples/databases/list-documents.md | 23 ++++--- .../examples/databases/list-indexes.md | 23 ++++--- .../server-swift/examples/databases/list.md | 17 ++--- .../examples/databases/update-collection.md | 25 +++---- .../examples/databases/update-document.md | 25 +++---- .../server-swift/examples/databases/update.md | 23 ++++--- .../examples/functions/create-build.md | 25 +++---- .../examples/functions/create-deployment.md | 27 ++++---- .../examples/functions/create-execution.md | 21 +++--- .../examples/functions/create-variable.md | 25 +++---- .../server-swift/examples/functions/create.md | 27 ++++---- .../examples/functions/delete-deployment.md | 23 ++++--- .../examples/functions/delete-variable.md | 23 ++++--- .../server-swift/examples/functions/delete.md | 21 +++--- .../examples/functions/get-deployment.md | 23 ++++--- .../examples/functions/get-execution.md | 23 ++++--- .../examples/functions/get-variable.md | 23 ++++--- .../server-swift/examples/functions/get.md | 21 +++--- .../examples/functions/list-deployments.md | 21 +++--- .../examples/functions/list-executions.md | 21 +++--- .../examples/functions/list-runtimes.md | 17 ++--- .../examples/functions/list-variables.md | 21 +++--- .../server-swift/examples/functions/list.md | 17 ++--- .../examples/functions/update-deployment.md | 23 ++++--- .../examples/functions/update-variable.md | 25 +++---- .../server-swift/examples/functions/update.md | 25 +++---- .../examples/health/get-antivirus.md | 17 ++--- .../server-swift/examples/health/get-cache.md | 17 ++--- .../server-swift/examples/health/get-d-b.md | 17 ++--- .../examples/health/get-queue-certificates.md | 17 ++--- .../examples/health/get-queue-functions.md | 17 ++--- .../examples/health/get-queue-logs.md | 17 ++--- .../examples/health/get-queue-webhooks.md | 17 ++--- .../examples/health/get-storage-local.md | 17 ++--- .../server-swift/examples/health/get-time.md | 17 ++--- .../1.1.x/server-swift/examples/health/get.md | 17 ++--- .../1.1.x/server-swift/examples/locale/get.md | 17 ++--- .../examples/locale/list-continents.md | 17 ++--- .../examples/locale/list-countries-e-u.md | 17 ++--- .../examples/locale/list-countries-phones.md | 17 ++--- .../examples/locale/list-countries.md | 17 ++--- .../examples/locale/list-currencies.md | 17 ++--- .../examples/locale/list-languages.md | 17 ++--- .../examples/storage/create-bucket.md | 23 ++++--- .../examples/storage/create-file.md | 25 +++---- .../examples/storage/delete-bucket.md | 21 +++--- .../examples/storage/delete-file.md | 23 ++++--- .../examples/storage/get-bucket.md | 21 +++--- .../examples/storage/get-file-download.md | 23 ++++--- .../examples/storage/get-file-preview.md | 23 ++++--- .../examples/storage/get-file-view.md | 23 ++++--- .../server-swift/examples/storage/get-file.md | 23 ++++--- .../examples/storage/list-buckets.md | 17 ++--- .../examples/storage/list-files.md | 21 +++--- .../examples/storage/update-bucket.md | 23 ++++--- .../examples/storage/update-file.md | 23 ++++--- .../examples/teams/create-membership.md | 27 ++++---- .../server-swift/examples/teams/create.md | 23 ++++--- .../examples/teams/delete-membership.md | 23 ++++--- .../server-swift/examples/teams/delete.md | 21 +++--- .../examples/teams/get-membership.md | 23 ++++--- .../1.1.x/server-swift/examples/teams/get.md | 21 +++--- .../examples/teams/list-memberships.md | 21 +++--- .../1.1.x/server-swift/examples/teams/list.md | 17 ++--- .../examples/teams/update-membership-roles.md | 25 +++---- .../teams/update-membership-status.md | 27 ++++---- .../server-swift/examples/teams/update.md | 23 ++++--- .../examples/users/create-argon2user.md | 25 +++---- .../examples/users/create-bcrypt-user.md | 25 +++---- .../examples/users/create-m-d5user.md | 25 +++---- .../examples/users/create-p-h-pass-user.md | 25 +++---- .../examples/users/create-s-h-a-user.md | 25 +++---- .../users/create-scrypt-modified-user.md | 31 ++++----- .../examples/users/create-scrypt-user.md | 35 +++++----- .../server-swift/examples/users/create.md | 21 +++--- .../examples/users/delete-session.md | 23 ++++--- .../examples/users/delete-sessions.md | 21 +++--- .../server-swift/examples/users/delete.md | 21 +++--- .../server-swift/examples/users/get-prefs.md | 21 +++--- .../1.1.x/server-swift/examples/users/get.md | 21 +++--- .../server-swift/examples/users/list-logs.md | 21 +++--- .../examples/users/list-memberships.md | 21 +++--- .../examples/users/list-sessions.md | 21 +++--- .../1.1.x/server-swift/examples/users/list.md | 17 ++--- .../users/update-email-verification.md | 23 ++++--- .../examples/users/update-email.md | 23 ++++--- .../examples/users/update-name.md | 23 ++++--- .../examples/users/update-password.md | 23 ++++--- .../users/update-phone-verification.md | 23 ++++--- .../examples/users/update-phone.md | 23 ++++--- .../examples/users/update-prefs.md | 23 ++++--- .../examples/users/update-status.md | 23 ++++--- 909 files changed, 13585 insertions(+), 8183 deletions(-) diff --git a/docs/examples/1.1.x/client-android/java/account/create-anonymous-session.md b/docs/examples/1.1.x/client-android/java/account/create-anonymous-session.md index 7d2123b58d..b1a2a25828 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-anonymous-session.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createAnonymousSession(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.createAnonymousSession(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-email-session.md b/docs/examples/1.1.x/client-android/java/account/create-email-session.md index 384dbaf342..055b828e9e 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-email-session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-email-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createEmailSession( - "email@example.com", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createEmailSession( + "email@example.com", + "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-j-w-t.md b/docs/examples/1.1.x/client-android/java/account/create-j-w-t.md index 86ad90557d..3a97c334ce 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-j-w-t.md +++ b/docs/examples/1.1.x/client-android/java/account/create-j-w-t.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createJWT(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.createJWT(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/client-android/java/account/create-magic-u-r-l-session.md index 1789eec99a..6c9fa7c662 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-magic-u-r-l-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createMagicURLSession( - "[USER_ID]", - "email@example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createMagicURLSession( + "[USER_ID]", + "email@example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-o-auth2session.md b/docs/examples/1.1.x/client-android/java/account/create-o-auth2session.md index a2f5d02dcf..e4cfb8d471 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-o-auth2session.md @@ -1,21 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createOAuth2Session( - "amazon", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createOAuth2Session( + this, + "amazon", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-phone-session.md b/docs/examples/1.1.x/client-android/java/account/create-phone-session.md index 7c54dbdcc6..94178d448d 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-phone-session.md +++ b/docs/examples/1.1.x/client-android/java/account/create-phone-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createPhoneSession( - "[USER_ID]", - "+12065550100" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createPhoneSession( + "[USER_ID]", + "+12065550100" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-phone-verification.md b/docs/examples/1.1.x/client-android/java/account/create-phone-verification.md index f3e95265b2..401b942888 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-phone-verification.md +++ b/docs/examples/1.1.x/client-android/java/account/create-phone-verification.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.createPhoneVerification(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-recovery.md b/docs/examples/1.1.x/client-android/java/account/create-recovery.md index 44773dd24c..459213bce9 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-recovery.md +++ b/docs/examples/1.1.x/client-android/java/account/create-recovery.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createRecovery( - "email@example.com", - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createRecovery( + "email@example.com", + "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create-verification.md b/docs/examples/1.1.x/client-android/java/account/create-verification.md index 02d29345ee..b8b1c206bf 100644 --- a/docs/examples/1.1.x/client-android/java/account/create-verification.md +++ b/docs/examples/1.1.x/client-android/java/account/create-verification.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.createVerification( - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.createVerification( + "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/create.md b/docs/examples/1.1.x/client-android/java/account/create.md index af0965e8a0..11a5168d60 100644 --- a/docs/examples/1.1.x/client-android/java/account/create.md +++ b/docs/examples/1.1.x/client-android/java/account/create.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.create( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.create( + "[USER_ID]", + "email@example.com", + "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/delete-session.md b/docs/examples/1.1.x/client-android/java/account/delete-session.md index b42b841bd1..b3549c708b 100644 --- a/docs/examples/1.1.x/client-android/java/account/delete-session.md +++ b/docs/examples/1.1.x/client-android/java/account/delete-session.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.deleteSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.deleteSession( + "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/delete-sessions.md b/docs/examples/1.1.x/client-android/java/account/delete-sessions.md index 847c5c138e..153c323b56 100644 --- a/docs/examples/1.1.x/client-android/java/account/delete-sessions.md +++ b/docs/examples/1.1.x/client-android/java/account/delete-sessions.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.deleteSessions(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.deleteSessions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/get-prefs.md b/docs/examples/1.1.x/client-android/java/account/get-prefs.md index d7777d8b3b..25ab6c3951 100644 --- a/docs/examples/1.1.x/client-android/java/account/get-prefs.md +++ b/docs/examples/1.1.x/client-android/java/account/get-prefs.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.getPrefs(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.getPrefs(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/get-session.md b/docs/examples/1.1.x/client-android/java/account/get-session.md index b7861b2198..8d4c95aaf2 100644 --- a/docs/examples/1.1.x/client-android/java/account/get-session.md +++ b/docs/examples/1.1.x/client-android/java/account/get-session.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.getSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.getSession( + "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/get.md b/docs/examples/1.1.x/client-android/java/account/get.md index 13516525bf..146a5e501d 100644 --- a/docs/examples/1.1.x/client-android/java/account/get.md +++ b/docs/examples/1.1.x/client-android/java/account/get.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.get(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/list-logs.md b/docs/examples/1.1.x/client-android/java/account/list-logs.md index d073d4e416..f33c413938 100644 --- a/docs/examples/1.1.x/client-android/java/account/list-logs.md +++ b/docs/examples/1.1.x/client-android/java/account/list-logs.md @@ -1,20 +1,47 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.listLogs( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.listLogs( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/list-sessions.md b/docs/examples/1.1.x/client-android/java/account/list-sessions.md index 91888bcbbc..5933f0399c 100644 --- a/docs/examples/1.1.x/client-android/java/account/list-sessions.md +++ b/docs/examples/1.1.x/client-android/java/account/list-sessions.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.listSessions(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.listSessions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-email.md b/docs/examples/1.1.x/client-android/java/account/update-email.md index 53dd0bd529..56a1bc0206 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-email.md +++ b/docs/examples/1.1.x/client-android/java/account/update-email.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateEmail( - "email@example.com", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateEmail( + "email@example.com", + "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/client-android/java/account/update-magic-u-r-l-session.md index e56da73dbf..d0734e18ee 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-android/java/account/update-magic-u-r-l-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateMagicURLSession( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateMagicURLSession( + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-name.md b/docs/examples/1.1.x/client-android/java/account/update-name.md index c722c85412..9842a2216e 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-name.md +++ b/docs/examples/1.1.x/client-android/java/account/update-name.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateName( - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateName( + "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-password.md b/docs/examples/1.1.x/client-android/java/account/update-password.md index e16aac5095..468bdc21da 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-password.md +++ b/docs/examples/1.1.x/client-android/java/account/update-password.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePassword( - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePassword( + "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-phone-session.md b/docs/examples/1.1.x/client-android/java/account/update-phone-session.md index 952c7e06b1..f8d35c734c 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-phone-session.md +++ b/docs/examples/1.1.x/client-android/java/account/update-phone-session.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePhoneSession( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePhoneSession( + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-phone-verification.md b/docs/examples/1.1.x/client-android/java/account/update-phone-verification.md index ec5ddf161e..7aec064194 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-phone-verification.md +++ b/docs/examples/1.1.x/client-android/java/account/update-phone-verification.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePhoneVerification( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePhoneVerification( + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-phone.md b/docs/examples/1.1.x/client-android/java/account/update-phone.md index 61cff456d9..77492127de 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-phone.md +++ b/docs/examples/1.1.x/client-android/java/account/update-phone.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePhone( - "+12065550100", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePhone( + "+12065550100", + "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-prefs.md b/docs/examples/1.1.x/client-android/java/account/update-prefs.md index a004b451e3..9f94b8fe59 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-prefs.md +++ b/docs/examples/1.1.x/client-android/java/account/update-prefs.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updatePrefs( - mapOf( "a" to "b" ) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updatePrefs( + mapOf( "a" to "b" ) + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-recovery.md b/docs/examples/1.1.x/client-android/java/account/update-recovery.md index e565a6bf0b..bfcc89ed19 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-recovery.md +++ b/docs/examples/1.1.x/client-android/java/account/update-recovery.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateRecovery( - "[USER_ID]", - "[SECRET]", - "password", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateRecovery( + "[USER_ID]", + "[SECRET]", + "password", + "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-session.md b/docs/examples/1.1.x/client-android/java/account/update-session.md index 4c5d975b19..80aff11b98 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-session.md +++ b/docs/examples/1.1.x/client-android/java/account/update-session.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateSession( + "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-status.md b/docs/examples/1.1.x/client-android/java/account/update-status.md index 739469ad89..0ef6a6e1f8 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-status.md +++ b/docs/examples/1.1.x/client-android/java/account/update-status.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateStatus(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Account account = new Account(client); + + account.updateStatus(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/account/update-verification.md b/docs/examples/1.1.x/client-android/java/account/update-verification.md index b05dbc2b29..8cf8d67363 100644 --- a/docs/examples/1.1.x/client-android/java/account/update-verification.md +++ b/docs/examples/1.1.x/client-android/java/account/update-verification.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Account account = new Account(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -account.updateVerification( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Account account = new Account(client); + + account.updateVerification( + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-browser.md b/docs/examples/1.1.x/client-android/java/avatars/get-browser.md index 8ad3f18828..fa88749dff 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-browser.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-browser.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getBrowser( - "aa", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getBrowser( + "aa", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-credit-card.md b/docs/examples/1.1.x/client-android/java/avatars/get-credit-card.md index 453718b36e..2ddda86cce 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-credit-card.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getCreditCard( - "amex", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getCreditCard( + "amex", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-favicon.md b/docs/examples/1.1.x/client-android/java/avatars/get-favicon.md index a5b9fa6756..39c1432260 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-favicon.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-favicon.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getFavicon( - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getFavicon( + "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-flag.md b/docs/examples/1.1.x/client-android/java/avatars/get-flag.md index 0bc48963c8..77bf3b1b1f 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-flag.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-flag.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getFlag( - "af", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getFlag( + "af", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-image.md b/docs/examples/1.1.x/client-android/java/avatars/get-image.md index d77d79c2bb..69371da6d3 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-image.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-image.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getImage( - "https://example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getImage( + "https://example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-initials.md b/docs/examples/1.1.x/client-android/java/avatars/get-initials.md index 491724f019..eea5669c2c 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-initials.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-initials.md @@ -1,20 +1,47 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getInitials( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getInitials( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/avatars/get-q-r.md b/docs/examples/1.1.x/client-android/java/avatars/get-q-r.md index ae1a11df2f..e2c48cdded 100644 --- a/docs/examples/1.1.x/client-android/java/avatars/get-q-r.md +++ b/docs/examples/1.1.x/client-android/java/avatars/get-q-r.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Avatars avatars = new Avatars(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -avatars.getQR( - "[TEXT]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Avatars avatars = new Avatars(client); + + avatars.getQR( + "[TEXT]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/create-document.md b/docs/examples/1.1.x/client-android/java/databases/create-document.md index d4412ce4e6..7fc322b8ca 100644 --- a/docs/examples/1.1.x/client-android/java/databases/create-document.md +++ b/docs/examples/1.1.x/client-android/java/databases/create-document.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.createDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - mapOf( "a" to "b" ), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.createDocument( + "[DATABASE_ID]", + "[COLLECTION_ID]", + "[DOCUMENT_ID]", + mapOf( "a" to "b" ), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/delete-document.md b/docs/examples/1.1.x/client-android/java/databases/delete-document.md index 90ad1cedb9..f42a09b498 100644 --- a/docs/examples/1.1.x/client-android/java/databases/delete-document.md +++ b/docs/examples/1.1.x/client-android/java/databases/delete-document.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.deleteDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.deleteDocument( + "[DATABASE_ID]", + "[COLLECTION_ID]", + "[DOCUMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/get-document.md b/docs/examples/1.1.x/client-android/java/databases/get-document.md index f4e7dc68cf..f1a4d449b4 100644 --- a/docs/examples/1.1.x/client-android/java/databases/get-document.md +++ b/docs/examples/1.1.x/client-android/java/databases/get-document.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.getDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.getDocument( + "[DATABASE_ID]", + "[COLLECTION_ID]", + "[DOCUMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/list-documents.md b/docs/examples/1.1.x/client-android/java/databases/list-documents.md index 6b897df50e..93d73336ec 100644 --- a/docs/examples/1.1.x/client-android/java/databases/list-documents.md +++ b/docs/examples/1.1.x/client-android/java/databases/list-documents.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.listDocuments( - "[DATABASE_ID]", - "[COLLECTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.listDocuments( + "[DATABASE_ID]", + "[COLLECTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/databases/update-document.md b/docs/examples/1.1.x/client-android/java/databases/update-document.md index 7f04c8ed12..81e55d48f1 100644 --- a/docs/examples/1.1.x/client-android/java/databases/update-document.md +++ b/docs/examples/1.1.x/client-android/java/databases/update-document.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Databases databases = new Databases(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -databases.updateDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Databases databases = new Databases(client); + + databases.updateDocument( + "[DATABASE_ID]", + "[COLLECTION_ID]", + "[DOCUMENT_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/functions/create-execution.md b/docs/examples/1.1.x/client-android/java/functions/create-execution.md index ee4eaf5761..ea30faddf3 100644 --- a/docs/examples/1.1.x/client-android/java/functions/create-execution.md +++ b/docs/examples/1.1.x/client-android/java/functions/create-execution.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Functions functions = new Functions(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -functions.createExecution( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Functions functions = new Functions(client); + + functions.createExecution( + "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/functions/get-execution.md b/docs/examples/1.1.x/client-android/java/functions/get-execution.md index 90153f5f40..2f4e57edce 100644 --- a/docs/examples/1.1.x/client-android/java/functions/get-execution.md +++ b/docs/examples/1.1.x/client-android/java/functions/get-execution.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Functions functions = new Functions(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -functions.getExecution( - "[FUNCTION_ID]", - "[EXECUTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Functions functions = new Functions(client); + + functions.getExecution( + "[FUNCTION_ID]", + "[EXECUTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/functions/list-executions.md b/docs/examples/1.1.x/client-android/java/functions/list-executions.md index fca903b1d3..68f767db9c 100644 --- a/docs/examples/1.1.x/client-android/java/functions/list-executions.md +++ b/docs/examples/1.1.x/client-android/java/functions/list-executions.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Functions functions = new Functions(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -functions.listExecutions( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Functions functions = new Functions(client); + + functions.listExecutions( + "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/get.md b/docs/examples/1.1.x/client-android/java/locale/get.md index 89de3696f6..417fc16f23 100644 --- a/docs/examples/1.1.x/client-android/java/locale/get.md +++ b/docs/examples/1.1.x/client-android/java/locale/get.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.get(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-continents.md b/docs/examples/1.1.x/client-android/java/locale/list-continents.md index 7205ad6444..970f066d51 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-continents.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-continents.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listContinents(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listContinents(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-countries-e-u.md b/docs/examples/1.1.x/client-android/java/locale/list-countries-e-u.md index d6f37be680..b2d0b29b6a 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-countries-e-u.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listCountriesEU(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-countries-phones.md b/docs/examples/1.1.x/client-android/java/locale/list-countries-phones.md index 1f947fe372..ed4d1f4f84 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-countries-phones.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listCountriesPhones(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-countries.md b/docs/examples/1.1.x/client-android/java/locale/list-countries.md index 5b8c0ba122..cb4000f464 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-countries.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-countries.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listCountries(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listCountries(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-currencies.md b/docs/examples/1.1.x/client-android/java/locale/list-currencies.md index 880e1b2e25..5423698276 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-currencies.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-currencies.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listCurrencies(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listCurrencies(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/locale/list-languages.md b/docs/examples/1.1.x/client-android/java/locale/list-languages.md index 318c6dc6e7..158c0e5722 100644 --- a/docs/examples/1.1.x/client-android/java/locale/list-languages.md +++ b/docs/examples/1.1.x/client-android/java/locale/list-languages.md @@ -1,18 +1,46 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Locale locale = new Locale(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -locale.listLanguages(new CoroutineCallback<>((result, error) -> { - if (error != null) - error.printStackTrace(); - return; + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID + + Locale locale = new Locale(client); + + locale.listLanguages(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); } - - Log.d("Appwrite", result.toString()); -})); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/create-file.md b/docs/examples/1.1.x/client-android/java/storage/create-file.md index 161f882886..32e0fd09f2 100644 --- a/docs/examples/1.1.x/client-android/java/storage/create-file.md +++ b/docs/examples/1.1.x/client-android/java/storage/create-file.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.models.InputFile; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.models.InputFile +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.createFile( - "[BUCKET_ID]", - "[FILE_ID]", - InputFile.fromPath("file.png"), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.createFile( + "[BUCKET_ID]", + "[FILE_ID]", + InputFile.fromPath("file.png"), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/delete-file.md b/docs/examples/1.1.x/client-android/java/storage/delete-file.md index 654c12735f..585593a8cb 100644 --- a/docs/examples/1.1.x/client-android/java/storage/delete-file.md +++ b/docs/examples/1.1.x/client-android/java/storage/delete-file.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.deleteFile( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.deleteFile( + "[BUCKET_ID]", + "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/get-file-download.md b/docs/examples/1.1.x/client-android/java/storage/get-file-download.md index f12302a31b..b16224804a 100644 --- a/docs/examples/1.1.x/client-android/java/storage/get-file-download.md +++ b/docs/examples/1.1.x/client-android/java/storage/get-file-download.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.getFileDownload( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.getFileDownload( + "[BUCKET_ID]", + "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/get-file-preview.md b/docs/examples/1.1.x/client-android/java/storage/get-file-preview.md index 8487922189..583c1a0a3c 100644 --- a/docs/examples/1.1.x/client-android/java/storage/get-file-preview.md +++ b/docs/examples/1.1.x/client-android/java/storage/get-file-preview.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.getFilePreview( - "[BUCKET_ID]", - "[FILE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.getFilePreview( + "[BUCKET_ID]", + "[FILE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/get-file-view.md b/docs/examples/1.1.x/client-android/java/storage/get-file-view.md index 825b538d6b..21a5074aca 100644 --- a/docs/examples/1.1.x/client-android/java/storage/get-file-view.md +++ b/docs/examples/1.1.x/client-android/java/storage/get-file-view.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.getFileView( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.getFileView( + "[BUCKET_ID]", + "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/get-file.md b/docs/examples/1.1.x/client-android/java/storage/get-file.md index bf9792216f..61740a9a46 100644 --- a/docs/examples/1.1.x/client-android/java/storage/get-file.md +++ b/docs/examples/1.1.x/client-android/java/storage/get-file.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.getFile( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.getFile( + "[BUCKET_ID]", + "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/list-files.md b/docs/examples/1.1.x/client-android/java/storage/list-files.md index fdf3e4fe80..a7ea06ec5b 100644 --- a/docs/examples/1.1.x/client-android/java/storage/list-files.md +++ b/docs/examples/1.1.x/client-android/java/storage/list-files.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.listFiles( - "[BUCKET_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.listFiles( + "[BUCKET_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/storage/update-file.md b/docs/examples/1.1.x/client-android/java/storage/update-file.md index 9d9f1928be..b3e8e904ef 100644 --- a/docs/examples/1.1.x/client-android/java/storage/update-file.md +++ b/docs/examples/1.1.x/client-android/java/storage/update-file.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Storage storage = new Storage(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -storage.updateFile( - "[BUCKET_ID]", - "[FILE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Storage storage = new Storage(client); + + storage.updateFile( + "[BUCKET_ID]", + "[FILE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/create-membership.md b/docs/examples/1.1.x/client-android/java/teams/create-membership.md index 9d567d6443..f4d96de575 100644 --- a/docs/examples/1.1.x/client-android/java/teams/create-membership.md +++ b/docs/examples/1.1.x/client-android/java/teams/create-membership.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.createMembership( - "[TEAM_ID]", - "email@example.com", - listOf(), - "https://example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.createMembership( + "[TEAM_ID]", + "email@example.com", + listOf(), + "https://example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/create.md b/docs/examples/1.1.x/client-android/java/teams/create.md index 52207c64d1..3723b30b03 100644 --- a/docs/examples/1.1.x/client-android/java/teams/create.md +++ b/docs/examples/1.1.x/client-android/java/teams/create.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.create( - "[TEAM_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.create( + "[TEAM_ID]", + "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/delete-membership.md b/docs/examples/1.1.x/client-android/java/teams/delete-membership.md index 92d6d377f5..98cb29ac75 100644 --- a/docs/examples/1.1.x/client-android/java/teams/delete-membership.md +++ b/docs/examples/1.1.x/client-android/java/teams/delete-membership.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.deleteMembership( - "[TEAM_ID]", - "[MEMBERSHIP_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.deleteMembership( + "[TEAM_ID]", + "[MEMBERSHIP_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/delete.md b/docs/examples/1.1.x/client-android/java/teams/delete.md index ed811951e0..828b457217 100644 --- a/docs/examples/1.1.x/client-android/java/teams/delete.md +++ b/docs/examples/1.1.x/client-android/java/teams/delete.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.delete( - "[TEAM_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.delete( + "[TEAM_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/get-membership.md b/docs/examples/1.1.x/client-android/java/teams/get-membership.md index 7e291715be..87c0160bf1 100644 --- a/docs/examples/1.1.x/client-android/java/teams/get-membership.md +++ b/docs/examples/1.1.x/client-android/java/teams/get-membership.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.getMembership( - "[TEAM_ID]", - "[MEMBERSHIP_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.getMembership( + "[TEAM_ID]", + "[MEMBERSHIP_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/get.md b/docs/examples/1.1.x/client-android/java/teams/get.md index 36063c5b6b..53ba33c4ca 100644 --- a/docs/examples/1.1.x/client-android/java/teams/get.md +++ b/docs/examples/1.1.x/client-android/java/teams/get.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.get( - "[TEAM_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.get( + "[TEAM_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/list-memberships.md b/docs/examples/1.1.x/client-android/java/teams/list-memberships.md index d195978b18..c53493d954 100644 --- a/docs/examples/1.1.x/client-android/java/teams/list-memberships.md +++ b/docs/examples/1.1.x/client-android/java/teams/list-memberships.md @@ -1,21 +1,48 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.listMemberships( - "[TEAM_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.listMemberships( + "[TEAM_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/list.md b/docs/examples/1.1.x/client-android/java/teams/list.md index b4998ffd49..61c2aa3f8e 100644 --- a/docs/examples/1.1.x/client-android/java/teams/list.md +++ b/docs/examples/1.1.x/client-android/java/teams/list.md @@ -1,20 +1,47 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/update-membership-roles.md b/docs/examples/1.1.x/client-android/java/teams/update-membership-roles.md index 680c9a3d56..ef6c67307e 100644 --- a/docs/examples/1.1.x/client-android/java/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/client-android/java/teams/update-membership-roles.md @@ -1,23 +1,50 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.updateMembershipRoles( - "[TEAM_ID]", - "[MEMBERSHIP_ID]", - listOf() - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.updateMembershipRoles( + "[TEAM_ID]", + "[MEMBERSHIP_ID]", + listOf() + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/update-membership-status.md b/docs/examples/1.1.x/client-android/java/teams/update-membership-status.md index 1015b2ead6..447d0da2c9 100644 --- a/docs/examples/1.1.x/client-android/java/teams/update-membership-status.md +++ b/docs/examples/1.1.x/client-android/java/teams/update-membership-status.md @@ -1,24 +1,51 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.updateMembershipStatus( - "[TEAM_ID]", - "[MEMBERSHIP_ID]", - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.updateMembershipStatus( + "[TEAM_ID]", + "[MEMBERSHIP_ID]", + "[USER_ID]", + "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/java/teams/update.md b/docs/examples/1.1.x/client-android/java/teams/update.md index 86d6a3f8dc..b4df429a07 100644 --- a/docs/examples/1.1.x/client-android/java/teams/update.md +++ b/docs/examples/1.1.x/client-android/java/teams/update.md @@ -1,22 +1,49 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2"); // Your project ID +public class MainActivity extends AppCompatActivity { -Teams teams = new Teams(client); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); -teams.update( - "[TEAM_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } + Client client = new Client(getApplicationContext()) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2"); // Your project ID - Log.d("Appwrite", result.toString()); - }) -); + Teams teams = new Teams(client); + + teams.update( + "[TEAM_ID]", + "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + json = response.body().string(); + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + } + ); + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-anonymous-session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-anonymous-session.md index ccefc0a055..5fa06994fb 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-anonymous-session.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createAnonymousSession() + val account = Account(client) + + GlobalScope.launch { + val response = account.createAnonymousSession() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-email-session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-email-session.md index c58799c15d..5dcec231b1 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-email-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-email-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createEmailSession( - email = "email@example.com", - password = "password" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createEmailSession( + email = "email@example.com", + password = "password" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-j-w-t.md b/docs/examples/1.1.x/client-android/kotlin/account/create-j-w-t.md index 59b73985a3..212838b7fd 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-j-w-t.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-j-w-t.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createJWT() + val account = Account(client) + + GlobalScope.launch { + val response = account.createJWT() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-magic-u-r-l-session.md index 5f36940107..15fa1c7a9f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-magic-u-r-l-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createMagicURLSession( - userId = "[USER_ID]", - email = "email@example.com", -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createMagicURLSession( + userId = "[USER_ID]", + email = "email@example.com", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-o-auth2session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-o-auth2session.md index f909b596b3..baf993069a 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-o-auth2session.md @@ -1,12 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -account.createOAuth2Session( - provider = "amazon", -) + val account = Account(client) + + GlobalScope.launch { + account.createOAuth2Session( + activity = this@MainActivity, + provider = "amazon", + ) + + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-phone-session.md b/docs/examples/1.1.x/client-android/kotlin/account/create-phone-session.md index 8f63c64e5b..d71c1d336f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-phone-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-phone-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createPhoneSession( - userId = "[USER_ID]", - phone = "+12065550100" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createPhoneSession( + userId = "[USER_ID]", + phone = "+12065550100" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-phone-verification.md b/docs/examples/1.1.x/client-android/kotlin/account/create-phone-verification.md index af36502534..ab0eccfb54 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-phone-verification.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-phone-verification.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createPhoneVerification() + val account = Account(client) + + GlobalScope.launch { + val response = account.createPhoneVerification() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-recovery.md b/docs/examples/1.1.x/client-android/kotlin/account/create-recovery.md index 23a3424836..2c1e7597b9 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-recovery.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-recovery.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createRecovery( - email = "email@example.com", - url = "https://example.com" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createRecovery( + email = "email@example.com", + url = "https://example.com" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create-verification.md b/docs/examples/1.1.x/client-android/kotlin/account/create-verification.md index 3fed01ba1f..1ebddee5cf 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create-verification.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create-verification.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.createVerification( - url = "https://example.com" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.createVerification( + url = "https://example.com" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/create.md b/docs/examples/1.1.x/client-android/kotlin/account/create.md index 2a55fb1641..ab2534f1db 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/create.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/create.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.create( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val account = Account(client) + + GlobalScope.launch { + val response = account.create( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/delete-session.md b/docs/examples/1.1.x/client-android/kotlin/account/delete-session.md index 5c8988f40f..e670623490 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/delete-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/delete-session.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.deleteSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.deleteSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/delete-sessions.md b/docs/examples/1.1.x/client-android/kotlin/account/delete-sessions.md index 86c9bc96ca..ec30efdb8f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/delete-sessions.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/delete-sessions.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.deleteSessions() + val account = Account(client) + + GlobalScope.launch { + val response = account.deleteSessions() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/get-prefs.md b/docs/examples/1.1.x/client-android/kotlin/account/get-prefs.md index 70fa29176c..9378cd2456 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/get-prefs.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/get-prefs.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.getPrefs() + val account = Account(client) + + GlobalScope.launch { + val response = account.getPrefs() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/get-session.md b/docs/examples/1.1.x/client-android/kotlin/account/get-session.md index 58248aed39..45f00b69fc 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/get-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/get-session.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.getSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.getSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/get.md b/docs/examples/1.1.x/client-android/kotlin/account/get.md index 09b0a17f19..c4c81a20aa 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/get.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/get.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.get() + val account = Account(client) + + GlobalScope.launch { + val response = account.get() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/list-logs.md b/docs/examples/1.1.x/client-android/kotlin/account/list-logs.md index dda9c721fe..397906b921 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/list-logs.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/list-logs.md @@ -1,11 +1,25 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.listLogs( -) + val account = Account(client) + + GlobalScope.launch { + val response = account.listLogs( + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/list-sessions.md b/docs/examples/1.1.x/client-android/kotlin/account/list-sessions.md index b7bb447b2d..0a0bc73ebc 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/list-sessions.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/list-sessions.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.listSessions() + val account = Account(client) + + GlobalScope.launch { + val response = account.listSessions() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-email.md b/docs/examples/1.1.x/client-android/kotlin/account/update-email.md index 2d1b66bdc0..a9ec88b8a4 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-email.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-email.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateEmail( - email = "email@example.com", - password = "password" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateEmail( + email = "email@example.com", + password = "password" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/client-android/kotlin/account/update-magic-u-r-l-session.md index 49af2177b6..3fe1b7c26e 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-magic-u-r-l-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateMagicURLSession( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateMagicURLSession( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-name.md b/docs/examples/1.1.x/client-android/kotlin/account/update-name.md index 5799344941..ce9d8a368f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-name.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-name.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateName( - name = "[NAME]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateName( + name = "[NAME]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-password.md b/docs/examples/1.1.x/client-android/kotlin/account/update-password.md index cdf8178441..edee78eab9 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-password.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-password.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePassword( - password = "password", -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePassword( + password = "password", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-phone-session.md b/docs/examples/1.1.x/client-android/kotlin/account/update-phone-session.md index 6efa2a4edb..c981991720 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-phone-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-phone-session.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePhoneSession( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePhoneSession( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-phone-verification.md b/docs/examples/1.1.x/client-android/kotlin/account/update-phone-verification.md index 1b90372faf..aa5eea3425 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-phone-verification.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-phone-verification.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePhoneVerification( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePhoneVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-phone.md b/docs/examples/1.1.x/client-android/kotlin/account/update-phone.md index 0534220eaa..72e612fa8b 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-phone.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-phone.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePhone( - phone = "+12065550100", - password = "password" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePhone( + phone = "+12065550100", + password = "password" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-prefs.md b/docs/examples/1.1.x/client-android/kotlin/account/update-prefs.md index 408988b28b..3059bc8196 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-prefs.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-prefs.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updatePrefs( - prefs = mapOf( "a" to "b" ) -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updatePrefs( + prefs = mapOf( "a" to "b" ) + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-recovery.md b/docs/examples/1.1.x/client-android/kotlin/account/update-recovery.md index fd28f6e600..81c00b4f26 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-recovery.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-recovery.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateRecovery( - userId = "[USER_ID]", - secret = "[SECRET]", - password = "password", - passwordAgain = "password" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateRecovery( + userId = "[USER_ID]", + secret = "[SECRET]", + password = "password", + passwordAgain = "password" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-session.md b/docs/examples/1.1.x/client-android/kotlin/account/update-session.md index 67d900e047..465320d097 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-session.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-session.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-status.md b/docs/examples/1.1.x/client-android/kotlin/account/update-status.md index 35a4027fc2..e138751287 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-status.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-status.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateStatus() + val account = Account(client) + + GlobalScope.launch { + val response = account.updateStatus() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/account/update-verification.md b/docs/examples/1.1.x/client-android/kotlin/account/update-verification.md index f87192e2f3..cea2592a73 100644 --- a/docs/examples/1.1.x/client-android/kotlin/account/update-verification.md +++ b/docs/examples/1.1.x/client-android/kotlin/account/update-verification.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val account = Account(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = account.updateVerification( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + + GlobalScope.launch { + val response = account.updateVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-browser.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-browser.md index 9ea67395b3..95a2201d6a 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-browser.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-browser.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getBrowser( - code = "aa", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getBrowser( + code = "aa", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-credit-card.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-credit-card.md index cf82474c17..7507c40c5c 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-credit-card.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getCreditCard( - code = "amex", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getCreditCard( + code = "amex", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-favicon.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-favicon.md index 102d7731b8..f8e2b400a8 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-favicon.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-favicon.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getFavicon( - url = "https://example.com" -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getFavicon( + url = "https://example.com" + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-flag.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-flag.md index 7a618a78d7..738ec8a91f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-flag.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-flag.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getFlag( - code = "af", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getFlag( + code = "af", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-image.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-image.md index fc1fe1d418..25171b1447 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-image.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-image.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getImage( - url = "https://example.com", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getImage( + url = "https://example.com", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-initials.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-initials.md index 448467e94f..e53a647b09 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-initials.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-initials.md @@ -1,11 +1,25 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getInitials( -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getInitials( + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/avatars/get-q-r.md b/docs/examples/1.1.x/client-android/kotlin/avatars/get-q-r.md index 8d24934b25..c9d60ea9c7 100644 --- a/docs/examples/1.1.x/client-android/kotlin/avatars/get-q-r.md +++ b/docs/examples/1.1.x/client-android/kotlin/avatars/get-q-r.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val avatars = Avatars(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = avatars.getQR( - text = "[TEXT]", -) + val avatars = Avatars(client) + + GlobalScope.launch { + val result = avatars.getQR( + text = "[TEXT]", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/create-document.md b/docs/examples/1.1.x/client-android/kotlin/databases/create-document.md index da4d1eba8d..8a755a265b 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/create-document.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/create-document.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.createDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.createDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + data = mapOf( "a" to "b" ), + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/delete-document.md b/docs/examples/1.1.x/client-android/kotlin/databases/delete-document.md index bb2193ebe1..f56293b880 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/delete-document.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/delete-document.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.deleteDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.deleteDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/get-document.md b/docs/examples/1.1.x/client-android/kotlin/databases/get-document.md index b81f3404ac..1f5bf29b10 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/get-document.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/get-document.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.getDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.getDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/list-documents.md b/docs/examples/1.1.x/client-android/kotlin/databases/list-documents.md index 0c2be1ade2..5277b46a01 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/list-documents.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/list-documents.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.listDocuments( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.listDocuments( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/databases/update-document.md b/docs/examples/1.1.x/client-android/kotlin/databases/update-document.md index 68cc42ee37..7807f5218f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/databases/update-document.md +++ b/docs/examples/1.1.x/client-android/kotlin/databases/update-document.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val databases = Databases(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = databases.updateDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", -) + val databases = Databases(client) + + GlobalScope.launch { + val response = databases.updateDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/functions/create-execution.md b/docs/examples/1.1.x/client-android/kotlin/functions/create-execution.md index b064201dbd..3a7e599f8c 100644 --- a/docs/examples/1.1.x/client-android/kotlin/functions/create-execution.md +++ b/docs/examples/1.1.x/client-android/kotlin/functions/create-execution.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val functions = Functions(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = functions.createExecution( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + + GlobalScope.launch { + val response = functions.createExecution( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/functions/get-execution.md b/docs/examples/1.1.x/client-android/kotlin/functions/get-execution.md index 2f9d5ef776..781f26c743 100644 --- a/docs/examples/1.1.x/client-android/kotlin/functions/get-execution.md +++ b/docs/examples/1.1.x/client-android/kotlin/functions/get-execution.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val functions = Functions(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = functions.getExecution( - functionId = "[FUNCTION_ID]", - executionId = "[EXECUTION_ID]" -) + val functions = Functions(client) + + GlobalScope.launch { + val response = functions.getExecution( + functionId = "[FUNCTION_ID]", + executionId = "[EXECUTION_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/functions/list-executions.md b/docs/examples/1.1.x/client-android/kotlin/functions/list-executions.md index d8a1aa1057..4f11574f0d 100644 --- a/docs/examples/1.1.x/client-android/kotlin/functions/list-executions.md +++ b/docs/examples/1.1.x/client-android/kotlin/functions/list-executions.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val functions = Functions(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = functions.listExecutions( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + + GlobalScope.launch { + val response = functions.listExecutions( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/get.md b/docs/examples/1.1.x/client-android/kotlin/locale/get.md index da6b040309..f89c66a7ed 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/get.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/get.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.get() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.get() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-continents.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-continents.md index 8836a6c17a..b582b40114 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-continents.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-continents.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listContinents() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listContinents() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-e-u.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-e-u.md index 051c1910d0..133da97f4b 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-e-u.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listCountriesEU() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listCountriesEU() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-phones.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-phones.md index c6efaaea79..7f17f47b7f 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries-phones.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listCountriesPhones() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listCountriesPhones() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries.md index 4e2eeeffdb..1d83452953 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-countries.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-countries.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listCountries() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listCountries() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-currencies.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-currencies.md index f565be6836..657652f3a0 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-currencies.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-currencies.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listCurrencies() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listCurrencies() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/locale/list-languages.md b/docs/examples/1.1.x/client-android/kotlin/locale/list-languages.md index 284f5ba803..bdf023ef9b 100644 --- a/docs/examples/1.1.x/client-android/kotlin/locale/list-languages.md +++ b/docs/examples/1.1.x/client-android/kotlin/locale/list-languages.md @@ -1,10 +1,24 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val locale = Locale(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = locale.listLanguages() + val locale = Locale(client) + + GlobalScope.launch { + val response = locale.listLanguages() + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/create-file.md b/docs/examples/1.1.x/client-android/kotlin/storage/create-file.md index fd52716182..d3d7c608e4 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/create-file.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/create-file.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.models.InputFile import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.createFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", - file = InputFile.fromPath("file.png"), -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.createFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + file = InputFile.fromPath("file.png"), + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/delete-file.md b/docs/examples/1.1.x/client-android/kotlin/storage/delete-file.md index 945e1b9720..1a4a5b9da1 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/delete-file.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/delete-file.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.deleteFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.deleteFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-download.md b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-download.md index b5fde879c0..3970fb8245 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-download.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-download.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = storage.getFileDownload( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + + GlobalScope.launch { + val result = storage.getFileDownload( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-preview.md b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-preview.md index ea7d8d4e90..780452729e 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-preview.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-preview.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = storage.getFilePreview( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", -) + val storage = Storage(client) + + GlobalScope.launch { + val result = storage.getFilePreview( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-view.md b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-view.md index c266fca1bc..107ad45679 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/get-file-view.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/get-file-view.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val result = storage.getFileView( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + + GlobalScope.launch { + val result = storage.getFileView( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/get-file.md b/docs/examples/1.1.x/client-android/kotlin/storage/get-file.md index 73fd9a8c44..30f640ba35 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/get-file.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/get-file.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.getFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.getFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/list-files.md b/docs/examples/1.1.x/client-android/kotlin/storage/list-files.md index f915e5ae31..20a253ab07 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/list-files.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/list-files.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.listFiles( - bucketId = "[BUCKET_ID]", -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.listFiles( + bucketId = "[BUCKET_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/storage/update-file.md b/docs/examples/1.1.x/client-android/kotlin/storage/update-file.md index 23ce52a822..35b1afb939 100644 --- a/docs/examples/1.1.x/client-android/kotlin/storage/update-file.md +++ b/docs/examples/1.1.x/client-android/kotlin/storage/update-file.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val storage = Storage(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = storage.updateFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", -) + val storage = Storage(client) + + GlobalScope.launch { + val response = storage.updateFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/create-membership.md b/docs/examples/1.1.x/client-android/kotlin/teams/create-membership.md index 60d39c037c..e2b7d16bfc 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/create-membership.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/create-membership.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.createMembership( - teamId = "[TEAM_ID]", - email = "email@example.com", - roles = listOf(), - url = "https://example.com", -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.createMembership( + teamId = "[TEAM_ID]", + email = "email@example.com", + roles = listOf(), + url = "https://example.com", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/create.md b/docs/examples/1.1.x/client-android/kotlin/teams/create.md index 26bef655e9..73857b80bb 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/create.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/create.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.create( - teamId = "[TEAM_ID]", - name = "[NAME]", -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.create( + teamId = "[TEAM_ID]", + name = "[NAME]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/delete-membership.md b/docs/examples/1.1.x/client-android/kotlin/teams/delete-membership.md index ac1b37a3c7..6545af5de7 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/delete-membership.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/delete-membership.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.deleteMembership( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.deleteMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/delete.md b/docs/examples/1.1.x/client-android/kotlin/teams/delete.md index c5bcd372e0..de12449562 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/delete.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/delete.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.delete( - teamId = "[TEAM_ID]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.delete( + teamId = "[TEAM_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/get-membership.md b/docs/examples/1.1.x/client-android/kotlin/teams/get-membership.md index 1ee6ec0c75..aa3f29e74d 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/get-membership.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/get-membership.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.getMembership( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.getMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/get.md b/docs/examples/1.1.x/client-android/kotlin/teams/get.md index 557e998942..54550b3ed6 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/get.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/get.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.get( - teamId = "[TEAM_ID]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.get( + teamId = "[TEAM_ID]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/list-memberships.md b/docs/examples/1.1.x/client-android/kotlin/teams/list-memberships.md index d7f2920683..32ef3bd823 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/list-memberships.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/list-memberships.md @@ -1,12 +1,26 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.listMemberships( - teamId = "[TEAM_ID]", -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.listMemberships( + teamId = "[TEAM_ID]", + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/list.md b/docs/examples/1.1.x/client-android/kotlin/teams/list.md index f056d33d81..6444205472 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/list.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/list.md @@ -1,11 +1,25 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.list( -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.list( + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-roles.md b/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-roles.md index 5727e111e1..d9a8a41895 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-roles.md @@ -1,14 +1,28 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.updateMembershipRoles( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]", - roles = listOf() -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.updateMembershipRoles( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + roles = listOf() + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-status.md b/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-status.md index a36b7100fe..f8e10fdafc 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-status.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/update-membership-status.md @@ -1,15 +1,29 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.updateMembershipStatus( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]", - userId = "[USER_ID]", - secret = "[SECRET]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.updateMembershipStatus( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-android/kotlin/teams/update.md b/docs/examples/1.1.x/client-android/kotlin/teams/update.md index 1a54434fd0..59dd69f081 100644 --- a/docs/examples/1.1.x/client-android/kotlin/teams/update.md +++ b/docs/examples/1.1.x/client-android/kotlin/teams/update.md @@ -1,13 +1,27 @@ +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) -val teams = Teams(client) + val client = Client(applicationContext) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID -val response = teams.update( - teamId = "[TEAM_ID]", - name = "[NAME]" -) + val teams = Teams(client) + + GlobalScope.launch { + val response = teams.update( + teamId = "[TEAM_ID]", + name = "[NAME]" + ) + val json = response.body?.string() + } + } +} \ No newline at end of file diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-anonymous-session.md b/docs/examples/1.1.x/client-apple/examples/account/create-anonymous-session.md index 866786858d..d2d71b9f00 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-anonymous-session.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.createAnonymousSession() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.createAnonymousSession() + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-email-session.md b/docs/examples/1.1.x/client-apple/examples/account/create-email-session.md index 9535bd3f39..e8e52ed637 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-email-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-email-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.createEmailSession( - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.createEmailSession( + email: "email@example.com", + password: "password" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-j-w-t.md b/docs/examples/1.1.x/client-apple/examples/account/create-j-w-t.md index 5a8ae637a9..51952f9953 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-j-w-t.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-j-w-t.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let jwt = try await account.createJWT() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let jwt = try await account.createJWT() + print(String(describing: jwt) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/client-apple/examples/account/create-magic-u-r-l-session.md index ad342dc2d4..3eab67aac4 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-magic-u-r-l-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createMagicURLSession( - userId: "[USER_ID]", - email: "email@example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createMagicURLSession( + userId: "[USER_ID]", + email: "email@example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-o-auth2session.md b/docs/examples/1.1.x/client-apple/examples/account/create-o-auth2session.md index 44b9229ae5..ddd7eb28a4 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-o-auth2session.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let success = try await account.createOAuth2Session( - provider: "amazon" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let success = try await account.createOAuth2Session( + provider: "amazon" + ) + print(String(describing: success) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-phone-session.md b/docs/examples/1.1.x/client-apple/examples/account/create-phone-session.md index c6b9f41c46..8b1dffa030 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-phone-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-phone-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createPhoneSession( - userId: "[USER_ID]", - phone: "+12065550100" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createPhoneSession( + userId: "[USER_ID]", + phone: "+12065550100" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-phone-verification.md b/docs/examples/1.1.x/client-apple/examples/account/create-phone-verification.md index 08a6367d8e..1033795be1 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-phone-verification.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-phone-verification.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createPhoneVerification() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createPhoneVerification() + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-recovery.md b/docs/examples/1.1.x/client-apple/examples/account/create-recovery.md index a946bfdde5..1f2d9b9e05 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-recovery.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-recovery.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createRecovery( - email: "email@example.com", - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createRecovery( + email: "email@example.com", + url: "https://example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create-verification.md b/docs/examples/1.1.x/client-apple/examples/account/create-verification.md index 6ce12ba9a5..cd0f9d5c87 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create-verification.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create-verification.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.createVerification( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.createVerification( + url: "https://example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/create.md b/docs/examples/1.1.x/client-apple/examples/account/create.md index 1031c8f3b3..bd6e152e53 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/create.md +++ b/docs/examples/1.1.x/client-apple/examples/account/create.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.create( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.create( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/delete-session.md b/docs/examples/1.1.x/client-apple/examples/account/delete-session.md index 3040b28a41..6f3dd76905 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/delete-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/delete-session.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let result = try await account.deleteSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let result = try await account.deleteSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/delete-sessions.md b/docs/examples/1.1.x/client-apple/examples/account/delete-sessions.md index e46d607fd5..f2721be95e 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/delete-sessions.md +++ b/docs/examples/1.1.x/client-apple/examples/account/delete-sessions.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let result = try await account.deleteSessions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let result = try await account.deleteSessions() + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/get-prefs.md b/docs/examples/1.1.x/client-apple/examples/account/get-prefs.md index 93c17c0d8b..6fb47ce31f 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/get-prefs.md +++ b/docs/examples/1.1.x/client-apple/examples/account/get-prefs.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let preferences = try await account.getPrefs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let preferences = try await account.getPrefs() + print(String(describing: preferences) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/get-session.md b/docs/examples/1.1.x/client-apple/examples/account/get-session.md index c291d10375..fa15d6d222 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/get-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/get-session.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.getSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.getSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/get.md b/docs/examples/1.1.x/client-apple/examples/account/get.md index f1c84ab8e9..09fd44655f 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/get.md +++ b/docs/examples/1.1.x/client-apple/examples/account/get.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.get() + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/list-logs.md b/docs/examples/1.1.x/client-apple/examples/account/list-logs.md index 830524e254..882df254ab 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/list-logs.md +++ b/docs/examples/1.1.x/client-apple/examples/account/list-logs.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let logList = try await account.listLogs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let logList = try await account.listLogs() + print(String(describing: logList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/list-sessions.md b/docs/examples/1.1.x/client-apple/examples/account/list-sessions.md index 4f7957adb8..1583fa43fd 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/list-sessions.md +++ b/docs/examples/1.1.x/client-apple/examples/account/list-sessions.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let sessionList = try await account.listSessions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let sessionList = try await account.listSessions() + print(String(describing: sessionList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-email.md b/docs/examples/1.1.x/client-apple/examples/account/update-email.md index 8355aad529..67e1275783 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-email.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-email.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updateEmail( - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updateEmail( + email: "email@example.com", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/client-apple/examples/account/update-magic-u-r-l-session.md index e522009087..34bfab9e80 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-magic-u-r-l-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.updateMagicURLSession( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.updateMagicURLSession( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-name.md b/docs/examples/1.1.x/client-apple/examples/account/update-name.md index c8e2a314e6..0ceff078a6 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-name.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-name.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updateName( - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updateName( + name: "[NAME]" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-password.md b/docs/examples/1.1.x/client-apple/examples/account/update-password.md index a3fe5703a1..a94bb2c3e6 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-password.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-password.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updatePassword( - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updatePassword( + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-phone-session.md b/docs/examples/1.1.x/client-apple/examples/account/update-phone-session.md index 125c68a00d..21d018ea2a 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-phone-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-phone-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.updatePhoneSession( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.updatePhoneSession( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-phone-verification.md b/docs/examples/1.1.x/client-apple/examples/account/update-phone-verification.md index e3e7bbf022..f148346920 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-phone-verification.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-phone-verification.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.updatePhoneVerification( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.updatePhoneVerification( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-phone.md b/docs/examples/1.1.x/client-apple/examples/account/update-phone.md index d56b7557b8..8f47342b25 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-phone.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-phone.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updatePhone( - phone: "+12065550100", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updatePhone( + phone: "+12065550100", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-prefs.md b/docs/examples/1.1.x/client-apple/examples/account/update-prefs.md index 53ef8add5f..ebccea57b3 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-prefs.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-prefs.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updatePrefs( - prefs: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updatePrefs( + prefs: [:] + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-recovery.md b/docs/examples/1.1.x/client-apple/examples/account/update-recovery.md index faec91819c..f412c0f35a 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-recovery.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-recovery.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.updateRecovery( - userId: "[USER_ID]", - secret: "[SECRET]", - password: "password", - passwordAgain: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.updateRecovery( + userId: "[USER_ID]", + secret: "[SECRET]", + password: "password", + passwordAgain: "password" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-session.md b/docs/examples/1.1.x/client-apple/examples/account/update-session.md index 712f3055a9..1d9282641c 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-session.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-session.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let session = try await account.updateSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let session = try await account.updateSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-status.md b/docs/examples/1.1.x/client-apple/examples/account/update-status.md index df5dd6747e..172eae0478 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-status.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-status.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let account = try await account.updateStatus() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let account = try await account.updateStatus() + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/client-apple/examples/account/update-verification.md b/docs/examples/1.1.x/client-apple/examples/account/update-verification.md index 15f936799d..10e46b19d1 100644 --- a/docs/examples/1.1.x/client-apple/examples/account/update-verification.md +++ b/docs/examples/1.1.x/client-apple/examples/account/update-verification.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let account = Account(client) - -let token = try await account.updateVerification( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let account = Account(client) + let token = try await account.updateVerification( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-browser.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-browser.md index a76a736e6f..536d9b6167 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-browser.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-browser.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getBrowser( - code: "aa" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getBrowser( + code: "aa" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-credit-card.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-credit-card.md index 7bcae6512b..7dff9411d0 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-credit-card.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getCreditCard( - code: "amex" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getCreditCard( + code: "amex" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-favicon.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-favicon.md index f0290354fa..1e2afab969 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-favicon.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-favicon.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getFavicon( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getFavicon( + url: "https://example.com" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-flag.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-flag.md index ceb3fe7ee3..43035a3530 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-flag.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-flag.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getFlag( - code: "af" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getFlag( + code: "af" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-image.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-image.md index e69ac106fd..a28299c153 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-image.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-image.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getImage( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getImage( + url: "https://example.com" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-initials.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-initials.md index 98086ca581..df22100428 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-initials.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-initials.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getInitials() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getInitials() + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/avatars/get-q-r.md b/docs/examples/1.1.x/client-apple/examples/avatars/get-q-r.md index c03754442a..a9e3e9bae1 100644 --- a/docs/examples/1.1.x/client-apple/examples/avatars/get-q-r.md +++ b/docs/examples/1.1.x/client-apple/examples/avatars/get-q-r.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getQR( - text: "[TEXT]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let avatars = Avatars(client) + let byteBuffer = try await avatars.getQR( + text: "[TEXT]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/create-document.md b/docs/examples/1.1.x/client-apple/examples/databases/create-document.md index efe8ca0e14..e97fa29bbe 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/create-document.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/create-document.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let document = try await databases.createDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]", - data: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let document = try await databases.createDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]", + data: [:] + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/delete-document.md b/docs/examples/1.1.x/client-apple/examples/databases/delete-document.md index 37b06a4abb..b8fec29238 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/delete-document.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/delete-document.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let result = try await databases.deleteDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let result = try await databases.deleteDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/get-document.md b/docs/examples/1.1.x/client-apple/examples/databases/get-document.md index ec9a78cff6..8d8999dde9 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/get-document.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/get-document.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let document = try await databases.getDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let document = try await databases.getDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/list-documents.md b/docs/examples/1.1.x/client-apple/examples/databases/list-documents.md index 75e97b0cdc..3468cf8fc3 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/list-documents.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/list-documents.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let documentList = try await databases.listDocuments( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let documentList = try await databases.listDocuments( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: documentList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/databases/update-document.md b/docs/examples/1.1.x/client-apple/examples/databases/update-document.md index 2aa6bfd36e..5f88a6253b 100644 --- a/docs/examples/1.1.x/client-apple/examples/databases/update-document.md +++ b/docs/examples/1.1.x/client-apple/examples/databases/update-document.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let databases = Databases(client) - -let document = try await databases.updateDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let databases = Databases(client) + let document = try await databases.updateDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/client-apple/examples/functions/create-execution.md b/docs/examples/1.1.x/client-apple/examples/functions/create-execution.md index 768b3a651e..f086125c35 100644 --- a/docs/examples/1.1.x/client-apple/examples/functions/create-execution.md +++ b/docs/examples/1.1.x/client-apple/examples/functions/create-execution.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let functions = Functions(client) - -let execution = try await functions.createExecution( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let functions = Functions(client) + let execution = try await functions.createExecution( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: execution) +} diff --git a/docs/examples/1.1.x/client-apple/examples/functions/get-execution.md b/docs/examples/1.1.x/client-apple/examples/functions/get-execution.md index cad2cd18f0..503c7f5412 100644 --- a/docs/examples/1.1.x/client-apple/examples/functions/get-execution.md +++ b/docs/examples/1.1.x/client-apple/examples/functions/get-execution.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let functions = Functions(client) - -let execution = try await functions.getExecution( - functionId: "[FUNCTION_ID]", - executionId: "[EXECUTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let functions = Functions(client) + let execution = try await functions.getExecution( + functionId: "[FUNCTION_ID]", + executionId: "[EXECUTION_ID]" + ) + print(String(describing: execution) +} diff --git a/docs/examples/1.1.x/client-apple/examples/functions/list-executions.md b/docs/examples/1.1.x/client-apple/examples/functions/list-executions.md index b3d2de15b6..45da8ee7a2 100644 --- a/docs/examples/1.1.x/client-apple/examples/functions/list-executions.md +++ b/docs/examples/1.1.x/client-apple/examples/functions/list-executions.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let functions = Functions(client) - -let executionList = try await functions.listExecutions( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let functions = Functions(client) + let executionList = try await functions.listExecutions( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: executionList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/get.md b/docs/examples/1.1.x/client-apple/examples/locale/get.md index 4c72036a6a..2b6101c5ed 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/get.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/get.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let locale = try await locale.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let locale = try await locale.get() + print(String(describing: locale) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-continents.md b/docs/examples/1.1.x/client-apple/examples/locale/list-continents.md index e6c1c41a15..03f3aa7631 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-continents.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-continents.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let continentList = try await locale.listContinents() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let continentList = try await locale.listContinents() + print(String(describing: continentList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-countries-e-u.md b/docs/examples/1.1.x/client-apple/examples/locale/list-countries-e-u.md index 8666c5a2ba..f25e383da6 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-countries-e-u.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let countryList = try await locale.listCountriesEU() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let countryList = try await locale.listCountriesEU() + print(String(describing: countryList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-countries-phones.md b/docs/examples/1.1.x/client-apple/examples/locale/list-countries-phones.md index 150dfbfdb6..31af0e230d 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-countries-phones.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let phoneList = try await locale.listCountriesPhones() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let phoneList = try await locale.listCountriesPhones() + print(String(describing: phoneList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-countries.md b/docs/examples/1.1.x/client-apple/examples/locale/list-countries.md index 0901da1cc5..29ac42ea59 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-countries.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-countries.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let countryList = try await locale.listCountries() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let countryList = try await locale.listCountries() + print(String(describing: countryList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-currencies.md b/docs/examples/1.1.x/client-apple/examples/locale/list-currencies.md index e43a416b48..aa0f6a0f0e 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-currencies.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-currencies.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let currencyList = try await locale.listCurrencies() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let currencyList = try await locale.listCurrencies() + print(String(describing: currencyList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/locale/list-languages.md b/docs/examples/1.1.x/client-apple/examples/locale/list-languages.md index 06d0ba6968..043690a4eb 100644 --- a/docs/examples/1.1.x/client-apple/examples/locale/list-languages.md +++ b/docs/examples/1.1.x/client-apple/examples/locale/list-languages.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let locale = Locale(client) - -let languageList = try await locale.listLanguages() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let locale = Locale(client) + let languageList = try await locale.listLanguages() + print(String(describing: languageList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/create-file.md b/docs/examples/1.1.x/client-apple/examples/storage/create-file.md index ff16ebf8ce..050dc8fc08 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/create-file.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/create-file.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let file = try await storage.createFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]", - file: InputFile.fromPath("file.png") -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let file = try await storage.createFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]", + file: InputFile.fromPath("file.png") + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/delete-file.md b/docs/examples/1.1.x/client-apple/examples/storage/delete-file.md index db31d920cd..5bad56677d 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/delete-file.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/delete-file.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let result = try await storage.deleteFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let result = try await storage.deleteFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/get-file-download.md b/docs/examples/1.1.x/client-apple/examples/storage/get-file-download.md index f139482ff8..1504f78d33 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/get-file-download.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/get-file-download.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let byteBuffer = try await storage.getFileDownload( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let byteBuffer = try await storage.getFileDownload( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/get-file-preview.md b/docs/examples/1.1.x/client-apple/examples/storage/get-file-preview.md index 09b28dcfa6..33b80c49ae 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/get-file-preview.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/get-file-preview.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let byteBuffer = try await storage.getFilePreview( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let byteBuffer = try await storage.getFilePreview( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/get-file-view.md b/docs/examples/1.1.x/client-apple/examples/storage/get-file-view.md index 819fdab39c..7e3524aabb 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/get-file-view.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/get-file-view.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let byteBuffer = try await storage.getFileView( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let byteBuffer = try await storage.getFileView( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/get-file.md b/docs/examples/1.1.x/client-apple/examples/storage/get-file.md index 9e274fc28e..1f2fae973d 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/get-file.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/get-file.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let file = try await storage.getFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let file = try await storage.getFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/list-files.md b/docs/examples/1.1.x/client-apple/examples/storage/list-files.md index 5d33f1b11f..01ae959e43 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/list-files.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/list-files.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let fileList = try await storage.listFiles( - bucketId: "[BUCKET_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let fileList = try await storage.listFiles( + bucketId: "[BUCKET_ID]" + ) + print(String(describing: fileList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/storage/update-file.md b/docs/examples/1.1.x/client-apple/examples/storage/update-file.md index ab33b619a2..85503f0199 100644 --- a/docs/examples/1.1.x/client-apple/examples/storage/update-file.md +++ b/docs/examples/1.1.x/client-apple/examples/storage/update-file.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let storage = Storage(client) - -let file = try await storage.updateFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let file = try await storage.updateFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/create-membership.md b/docs/examples/1.1.x/client-apple/examples/teams/create-membership.md index c21c26814f..5a81e431d9 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/create-membership.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/create-membership.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membership = try await teams.createMembership( - teamId: "[TEAM_ID]", - email: "email@example.com", - roles: [], - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membership = try await teams.createMembership( + teamId: "[TEAM_ID]", + email: "email@example.com", + roles: [], + url: "https://example.com" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/create.md b/docs/examples/1.1.x/client-apple/examples/teams/create.md index 5fe1c087e7..227ceb37b2 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/create.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/create.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let team = try await teams.create( - teamId: "[TEAM_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let team = try await teams.create( + teamId: "[TEAM_ID]", + name: "[NAME]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/delete-membership.md b/docs/examples/1.1.x/client-apple/examples/teams/delete-membership.md index 7ee2d2a3a0..46a1ad7728 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/delete-membership.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/delete-membership.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let result = try await teams.deleteMembership( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let result = try await teams.deleteMembership( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/delete.md b/docs/examples/1.1.x/client-apple/examples/teams/delete.md index 6a0346ca6a..d117a8bbf7 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/delete.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/delete.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let result = try await teams.delete( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let result = try await teams.delete( + teamId: "[TEAM_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/get-membership.md b/docs/examples/1.1.x/client-apple/examples/teams/get-membership.md index 6c1ef643ed..8d19d11072 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/get-membership.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/get-membership.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membership = try await teams.getMembership( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membership = try await teams.getMembership( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/get.md b/docs/examples/1.1.x/client-apple/examples/teams/get.md index 68b5db8115..e4e0b9b68b 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/get.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/get.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let team = try await teams.get( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let team = try await teams.get( + teamId: "[TEAM_ID]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/list-memberships.md b/docs/examples/1.1.x/client-apple/examples/teams/list-memberships.md index eac7535ca9..3e3d89ff6f 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/list-memberships.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/list-memberships.md @@ -1,12 +1,13 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membershipList = try await teams.listMemberships( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membershipList = try await teams.listMemberships( + teamId: "[TEAM_ID]" + ) + print(String(describing: membershipList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/list.md b/docs/examples/1.1.x/client-apple/examples/teams/list.md index 7d662d2cfd..a1e454fd6c 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/list.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/list.md @@ -1,10 +1,11 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let teamList = try await teams.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let teamList = try await teams.list() + print(String(describing: teamList) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/update-membership-roles.md b/docs/examples/1.1.x/client-apple/examples/teams/update-membership-roles.md index c59bf9223a..68ed875e42 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/update-membership-roles.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membership = try await teams.updateMembershipRoles( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]", - roles: [] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membership = try await teams.updateMembershipRoles( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]", + roles: [] + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/update-membership-status.md b/docs/examples/1.1.x/client-apple/examples/teams/update-membership-status.md index a98095445d..9712539a6e 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/update-membership-status.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/update-membership-status.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let membership = try await teams.updateMembershipStatus( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]", - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let membership = try await teams.updateMembershipStatus( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]", + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/client-apple/examples/teams/update.md b/docs/examples/1.1.x/client-apple/examples/teams/update.md index 36bc40fe60..90a4332756 100644 --- a/docs/examples/1.1.x/client-apple/examples/teams/update.md +++ b/docs/examples/1.1.x/client-apple/examples/teams/update.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - -let teams = Teams(client) - -let team = try await teams.update( - teamId: "[TEAM_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let teams = Teams(client) + let team = try await teams.update( + teamId: "[TEAM_ID]", + name: "[NAME]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/client-web/examples/account/create-anonymous-session.md b/docs/examples/1.1.x/client-web/examples/account/create-anonymous-session.md index e1c53e7462..a1ff484477 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-anonymous-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-email-session.md b/docs/examples/1.1.x/client-web/examples/account/create-email-session.md index a8d5698bb1..43a0aa25a0 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-email-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-email-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-j-w-t.md b/docs/examples/1.1.x/client-web/examples/account/create-j-w-t.md index 97b608e052..3b5c7ed679 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-j-w-t.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-j-w-t.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/client-web/examples/account/create-magic-u-r-l-session.md index 6377e1d5a8..9339d6742c 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-magic-u-r-l-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-o-auth2session.md b/docs/examples/1.1.x/client-web/examples/account/create-o-auth2session.md index ca177f2094..25e67b15ec 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-o-auth2session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-phone-session.md b/docs/examples/1.1.x/client-web/examples/account/create-phone-session.md index 5b2c8be4db..df2efe0722 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-phone-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-phone-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-phone-verification.md b/docs/examples/1.1.x/client-web/examples/account/create-phone-verification.md index b22afc2fc7..f325a9210f 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-phone-verification.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-recovery.md b/docs/examples/1.1.x/client-web/examples/account/create-recovery.md index 389aeeedbe..4f737edf3d 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-recovery.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-recovery.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create-verification.md b/docs/examples/1.1.x/client-web/examples/account/create-verification.md index c78f25dd95..0e7162c8cf 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create-verification.md +++ b/docs/examples/1.1.x/client-web/examples/account/create-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/create.md b/docs/examples/1.1.x/client-web/examples/account/create.md index 6a8a39755c..5b275bd1ba 100644 --- a/docs/examples/1.1.x/client-web/examples/account/create.md +++ b/docs/examples/1.1.x/client-web/examples/account/create.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/delete-session.md b/docs/examples/1.1.x/client-web/examples/account/delete-session.md index 2387a17237..a23a1f25e5 100644 --- a/docs/examples/1.1.x/client-web/examples/account/delete-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/delete-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/delete-sessions.md b/docs/examples/1.1.x/client-web/examples/account/delete-sessions.md index d587a898f5..58495385f1 100644 --- a/docs/examples/1.1.x/client-web/examples/account/delete-sessions.md +++ b/docs/examples/1.1.x/client-web/examples/account/delete-sessions.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/get-prefs.md b/docs/examples/1.1.x/client-web/examples/account/get-prefs.md index a4d8a3ca8a..a355c68ee0 100644 --- a/docs/examples/1.1.x/client-web/examples/account/get-prefs.md +++ b/docs/examples/1.1.x/client-web/examples/account/get-prefs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/get-session.md b/docs/examples/1.1.x/client-web/examples/account/get-session.md index a15fbab92c..dd0c08633e 100644 --- a/docs/examples/1.1.x/client-web/examples/account/get-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/get-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/get.md b/docs/examples/1.1.x/client-web/examples/account/get.md index f5b1d15148..fd26ad70dc 100644 --- a/docs/examples/1.1.x/client-web/examples/account/get.md +++ b/docs/examples/1.1.x/client-web/examples/account/get.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/list-logs.md b/docs/examples/1.1.x/client-web/examples/account/list-logs.md index 193ea1328f..4ce60e4314 100644 --- a/docs/examples/1.1.x/client-web/examples/account/list-logs.md +++ b/docs/examples/1.1.x/client-web/examples/account/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/list-sessions.md b/docs/examples/1.1.x/client-web/examples/account/list-sessions.md index 9518040303..d7e901c406 100644 --- a/docs/examples/1.1.x/client-web/examples/account/list-sessions.md +++ b/docs/examples/1.1.x/client-web/examples/account/list-sessions.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-email.md b/docs/examples/1.1.x/client-web/examples/account/update-email.md index e2a89ae63b..6e3d603801 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-email.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-email.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/client-web/examples/account/update-magic-u-r-l-session.md index 1941af7f45..1934263b69 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-magic-u-r-l-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-name.md b/docs/examples/1.1.x/client-web/examples/account/update-name.md index ce9d2cc884..24a27f1363 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-name.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-name.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-password.md b/docs/examples/1.1.x/client-web/examples/account/update-password.md index b57d34fbd9..5ace968e6b 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-password.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-password.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-phone-session.md b/docs/examples/1.1.x/client-web/examples/account/update-phone-session.md index 6c8507cc31..8ad2051057 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-phone-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-phone-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-phone-verification.md b/docs/examples/1.1.x/client-web/examples/account/update-phone-verification.md index a9580ddd8d..b96f3bea21 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-phone-verification.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-phone.md b/docs/examples/1.1.x/client-web/examples/account/update-phone.md index b1562bfadd..33dac5105f 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-phone.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-phone.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-prefs.md b/docs/examples/1.1.x/client-web/examples/account/update-prefs.md index 2d7dd060de..4948631a27 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-prefs.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-prefs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-recovery.md b/docs/examples/1.1.x/client-web/examples/account/update-recovery.md index 7c8c39b6fa..85915f1ab9 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-recovery.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-recovery.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-session.md b/docs/examples/1.1.x/client-web/examples/account/update-session.md index d02b49dc56..70fe5faa11 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-session.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-status.md b/docs/examples/1.1.x/client-web/examples/account/update-status.md index 8706f50504..a7c7817338 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-status.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-status.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/account/update-verification.md b/docs/examples/1.1.x/client-web/examples/account/update-verification.md index c75aa5fba3..27d5cbc2f7 100644 --- a/docs/examples/1.1.x/client-web/examples/account/update-verification.md +++ b/docs/examples/1.1.x/client-web/examples/account/update-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-browser.md b/docs/examples/1.1.x/client-web/examples/avatars/get-browser.md index 8c7c3f2a34..20480ce124 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-browser.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-browser.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-credit-card.md b/docs/examples/1.1.x/client-web/examples/avatars/get-credit-card.md index 219ac51f6b..cdbc4a0067 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-credit-card.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-favicon.md b/docs/examples/1.1.x/client-web/examples/avatars/get-favicon.md index dcd749e7ef..f8db5c378c 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-favicon.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-favicon.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-flag.md b/docs/examples/1.1.x/client-web/examples/avatars/get-flag.md index 22a3cc024f..e609fb299d 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-flag.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-flag.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-image.md b/docs/examples/1.1.x/client-web/examples/avatars/get-image.md index 7b5c024d71..468f6a3c54 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-image.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-image.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-initials.md b/docs/examples/1.1.x/client-web/examples/avatars/get-initials.md index 3a016333c1..d061813297 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-initials.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-initials.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/avatars/get-q-r.md b/docs/examples/1.1.x/client-web/examples/avatars/get-q-r.md index e4cefc4d23..86fed127e9 100644 --- a/docs/examples/1.1.x/client-web/examples/avatars/get-q-r.md +++ b/docs/examples/1.1.x/client-web/examples/avatars/get-q-r.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/create-document.md b/docs/examples/1.1.x/client-web/examples/databases/create-document.md index 94afca4aad..5b8d89ad47 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/create-document.md +++ b/docs/examples/1.1.x/client-web/examples/databases/create-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/delete-document.md b/docs/examples/1.1.x/client-web/examples/databases/delete-document.md index 1603c98ca7..e201280445 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/delete-document.md +++ b/docs/examples/1.1.x/client-web/examples/databases/delete-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/get-document.md b/docs/examples/1.1.x/client-web/examples/databases/get-document.md index 397c1044aa..89314e880a 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/get-document.md +++ b/docs/examples/1.1.x/client-web/examples/databases/get-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/list-documents.md b/docs/examples/1.1.x/client-web/examples/databases/list-documents.md index 6c396a3c4d..a4afd21031 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/list-documents.md +++ b/docs/examples/1.1.x/client-web/examples/databases/list-documents.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/databases/update-document.md b/docs/examples/1.1.x/client-web/examples/databases/update-document.md index f1bb79da58..2d59a8ad85 100644 --- a/docs/examples/1.1.x/client-web/examples/databases/update-document.md +++ b/docs/examples/1.1.x/client-web/examples/databases/update-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/functions/create-execution.md b/docs/examples/1.1.x/client-web/examples/functions/create-execution.md index 99535d633e..2b64bc9f7b 100644 --- a/docs/examples/1.1.x/client-web/examples/functions/create-execution.md +++ b/docs/examples/1.1.x/client-web/examples/functions/create-execution.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/functions/get-execution.md b/docs/examples/1.1.x/client-web/examples/functions/get-execution.md index e607477fe2..f5046a08c4 100644 --- a/docs/examples/1.1.x/client-web/examples/functions/get-execution.md +++ b/docs/examples/1.1.x/client-web/examples/functions/get-execution.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/functions/list-executions.md b/docs/examples/1.1.x/client-web/examples/functions/list-executions.md index bcf2a7a48d..99186a95de 100644 --- a/docs/examples/1.1.x/client-web/examples/functions/list-executions.md +++ b/docs/examples/1.1.x/client-web/examples/functions/list-executions.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/get.md b/docs/examples/1.1.x/client-web/examples/locale/get.md index f952603a8a..634256c83e 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/get.md +++ b/docs/examples/1.1.x/client-web/examples/locale/get.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-continents.md b/docs/examples/1.1.x/client-web/examples/locale/list-continents.md index 7df98f8862..e79a8eab5c 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-continents.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-continents.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-countries-e-u.md b/docs/examples/1.1.x/client-web/examples/locale/list-countries-e-u.md index 8a26c02bd3..964bed390b 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-countries-e-u.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-countries-phones.md b/docs/examples/1.1.x/client-web/examples/locale/list-countries-phones.md index c1b9c48b55..65ec4f4dbd 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-countries-phones.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-countries.md b/docs/examples/1.1.x/client-web/examples/locale/list-countries.md index 8ef34dc6d9..6b7e8e665f 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-countries.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-countries.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-currencies.md b/docs/examples/1.1.x/client-web/examples/locale/list-currencies.md index 80efe589c7..3638c2e1bb 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-currencies.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-currencies.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/locale/list-languages.md b/docs/examples/1.1.x/client-web/examples/locale/list-languages.md index 3c1253e4c5..bffa5eb0c6 100644 --- a/docs/examples/1.1.x/client-web/examples/locale/list-languages.md +++ b/docs/examples/1.1.x/client-web/examples/locale/list-languages.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/create-file.md b/docs/examples/1.1.x/client-web/examples/storage/create-file.md index 710adbade3..10992d2b89 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/create-file.md +++ b/docs/examples/1.1.x/client-web/examples/storage/create-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/delete-file.md b/docs/examples/1.1.x/client-web/examples/storage/delete-file.md index 7b5ecaa599..4512a8c1ce 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/delete-file.md +++ b/docs/examples/1.1.x/client-web/examples/storage/delete-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/get-file-download.md b/docs/examples/1.1.x/client-web/examples/storage/get-file-download.md index 0fdd3c5614..17c06600b3 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/get-file-download.md +++ b/docs/examples/1.1.x/client-web/examples/storage/get-file-download.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/get-file-preview.md b/docs/examples/1.1.x/client-web/examples/storage/get-file-preview.md index 262cd023bf..52866d108a 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/get-file-preview.md +++ b/docs/examples/1.1.x/client-web/examples/storage/get-file-preview.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/get-file-view.md b/docs/examples/1.1.x/client-web/examples/storage/get-file-view.md index bae90e9d31..7bb6c67d51 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/get-file-view.md +++ b/docs/examples/1.1.x/client-web/examples/storage/get-file-view.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/get-file.md b/docs/examples/1.1.x/client-web/examples/storage/get-file.md index 3f6741a5e3..3263865c73 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/get-file.md +++ b/docs/examples/1.1.x/client-web/examples/storage/get-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/list-files.md b/docs/examples/1.1.x/client-web/examples/storage/list-files.md index 7868a925f6..92d75742a5 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/list-files.md +++ b/docs/examples/1.1.x/client-web/examples/storage/list-files.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/storage/update-file.md b/docs/examples/1.1.x/client-web/examples/storage/update-file.md index 8f3e2484f8..1313e30cff 100644 --- a/docs/examples/1.1.x/client-web/examples/storage/update-file.md +++ b/docs/examples/1.1.x/client-web/examples/storage/update-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/create-membership.md b/docs/examples/1.1.x/client-web/examples/teams/create-membership.md index 005980871a..6cb7d87b7f 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/create-membership.md +++ b/docs/examples/1.1.x/client-web/examples/teams/create-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/create.md b/docs/examples/1.1.x/client-web/examples/teams/create.md index 2879eaa6ae..2c40c9017d 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/create.md +++ b/docs/examples/1.1.x/client-web/examples/teams/create.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/delete-membership.md b/docs/examples/1.1.x/client-web/examples/teams/delete-membership.md index 3275878b9b..828674a86f 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/delete-membership.md +++ b/docs/examples/1.1.x/client-web/examples/teams/delete-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/delete.md b/docs/examples/1.1.x/client-web/examples/teams/delete.md index 806ef8f60e..b9b79ed1b7 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/delete.md +++ b/docs/examples/1.1.x/client-web/examples/teams/delete.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/get-membership.md b/docs/examples/1.1.x/client-web/examples/teams/get-membership.md index aa583b3e12..cce63e7fba 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/get-membership.md +++ b/docs/examples/1.1.x/client-web/examples/teams/get-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/get.md b/docs/examples/1.1.x/client-web/examples/teams/get.md index cfcafefc03..3a7185319a 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/get.md +++ b/docs/examples/1.1.x/client-web/examples/teams/get.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/list-memberships.md b/docs/examples/1.1.x/client-web/examples/teams/list-memberships.md index b507f82e92..12bef1a6f8 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/list-memberships.md +++ b/docs/examples/1.1.x/client-web/examples/teams/list-memberships.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/list.md b/docs/examples/1.1.x/client-web/examples/teams/list.md index 2333ab4155..1aea267038 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/list.md +++ b/docs/examples/1.1.x/client-web/examples/teams/list.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/update-membership-roles.md b/docs/examples/1.1.x/client-web/examples/teams/update-membership-roles.md index e5ab84867e..ca76ead1d6 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/client-web/examples/teams/update-membership-roles.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/update-membership-status.md b/docs/examples/1.1.x/client-web/examples/teams/update-membership-status.md index fdd391ca22..4a29cdc116 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/update-membership-status.md +++ b/docs/examples/1.1.x/client-web/examples/teams/update-membership-status.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/client-web/examples/teams/update.md b/docs/examples/1.1.x/client-web/examples/teams/update.md index ce54a850d8..a59cc80000 100644 --- a/docs/examples/1.1.x/client-web/examples/teams/update.md +++ b/docs/examples/1.1.x/client-web/examples/teams/update.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-anonymous-session.md b/docs/examples/1.1.x/console-web/examples/account/create-anonymous-session.md index e1c53e7462..a1ff484477 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-anonymous-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-anonymous-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-email-session.md b/docs/examples/1.1.x/console-web/examples/account/create-email-session.md index a8d5698bb1..43a0aa25a0 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-email-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-email-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-j-w-t.md b/docs/examples/1.1.x/console-web/examples/account/create-j-w-t.md index 97b608e052..3b5c7ed679 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-j-w-t.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-j-w-t.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-magic-u-r-l-session.md b/docs/examples/1.1.x/console-web/examples/account/create-magic-u-r-l-session.md index 6377e1d5a8..9339d6742c 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-magic-u-r-l-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-o-auth2session.md b/docs/examples/1.1.x/console-web/examples/account/create-o-auth2session.md index ca177f2094..25e67b15ec 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-o-auth2session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-o-auth2session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-phone-session.md b/docs/examples/1.1.x/console-web/examples/account/create-phone-session.md index 5b2c8be4db..df2efe0722 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-phone-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-phone-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-phone-verification.md b/docs/examples/1.1.x/console-web/examples/account/create-phone-verification.md index b22afc2fc7..f325a9210f 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-phone-verification.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-recovery.md b/docs/examples/1.1.x/console-web/examples/account/create-recovery.md index 389aeeedbe..4f737edf3d 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-recovery.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-recovery.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create-verification.md b/docs/examples/1.1.x/console-web/examples/account/create-verification.md index c78f25dd95..0e7162c8cf 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create-verification.md +++ b/docs/examples/1.1.x/console-web/examples/account/create-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/create.md b/docs/examples/1.1.x/console-web/examples/account/create.md index 6a8a39755c..5b275bd1ba 100644 --- a/docs/examples/1.1.x/console-web/examples/account/create.md +++ b/docs/examples/1.1.x/console-web/examples/account/create.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/delete-session.md b/docs/examples/1.1.x/console-web/examples/account/delete-session.md index 2387a17237..a23a1f25e5 100644 --- a/docs/examples/1.1.x/console-web/examples/account/delete-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/delete-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/delete-sessions.md b/docs/examples/1.1.x/console-web/examples/account/delete-sessions.md index d587a898f5..58495385f1 100644 --- a/docs/examples/1.1.x/console-web/examples/account/delete-sessions.md +++ b/docs/examples/1.1.x/console-web/examples/account/delete-sessions.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/get-prefs.md b/docs/examples/1.1.x/console-web/examples/account/get-prefs.md index a4d8a3ca8a..a355c68ee0 100644 --- a/docs/examples/1.1.x/console-web/examples/account/get-prefs.md +++ b/docs/examples/1.1.x/console-web/examples/account/get-prefs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/get-session.md b/docs/examples/1.1.x/console-web/examples/account/get-session.md index a15fbab92c..dd0c08633e 100644 --- a/docs/examples/1.1.x/console-web/examples/account/get-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/get-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/get.md b/docs/examples/1.1.x/console-web/examples/account/get.md index f5b1d15148..fd26ad70dc 100644 --- a/docs/examples/1.1.x/console-web/examples/account/get.md +++ b/docs/examples/1.1.x/console-web/examples/account/get.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/list-logs.md b/docs/examples/1.1.x/console-web/examples/account/list-logs.md index 193ea1328f..4ce60e4314 100644 --- a/docs/examples/1.1.x/console-web/examples/account/list-logs.md +++ b/docs/examples/1.1.x/console-web/examples/account/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/list-sessions.md b/docs/examples/1.1.x/console-web/examples/account/list-sessions.md index 9518040303..d7e901c406 100644 --- a/docs/examples/1.1.x/console-web/examples/account/list-sessions.md +++ b/docs/examples/1.1.x/console-web/examples/account/list-sessions.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-email.md b/docs/examples/1.1.x/console-web/examples/account/update-email.md index e2a89ae63b..6e3d603801 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-email.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-email.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.1.x/console-web/examples/account/update-magic-u-r-l-session.md index 1941af7f45..1934263b69 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-magic-u-r-l-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-name.md b/docs/examples/1.1.x/console-web/examples/account/update-name.md index ce9d2cc884..24a27f1363 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-name.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-name.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-password.md b/docs/examples/1.1.x/console-web/examples/account/update-password.md index b57d34fbd9..5ace968e6b 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-password.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-password.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-phone-session.md b/docs/examples/1.1.x/console-web/examples/account/update-phone-session.md index 6c8507cc31..8ad2051057 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-phone-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-phone-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-phone-verification.md b/docs/examples/1.1.x/console-web/examples/account/update-phone-verification.md index a9580ddd8d..b96f3bea21 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-phone-verification.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-phone.md b/docs/examples/1.1.x/console-web/examples/account/update-phone.md index b1562bfadd..33dac5105f 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-phone.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-phone.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-prefs.md b/docs/examples/1.1.x/console-web/examples/account/update-prefs.md index 2d7dd060de..4948631a27 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-prefs.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-prefs.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-recovery.md b/docs/examples/1.1.x/console-web/examples/account/update-recovery.md index 7c8c39b6fa..85915f1ab9 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-recovery.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-recovery.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-session.md b/docs/examples/1.1.x/console-web/examples/account/update-session.md index d02b49dc56..70fe5faa11 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-session.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-session.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-status.md b/docs/examples/1.1.x/console-web/examples/account/update-status.md index 8706f50504..a7c7817338 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-status.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-status.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/account/update-verification.md b/docs/examples/1.1.x/console-web/examples/account/update-verification.md index c75aa5fba3..27d5cbc2f7 100644 --- a/docs/examples/1.1.x/console-web/examples/account/update-verification.md +++ b/docs/examples/1.1.x/console-web/examples/account/update-verification.md @@ -1,4 +1,4 @@ -import { Client, Account } from "packageName"; +import { Client, Account } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-browser.md b/docs/examples/1.1.x/console-web/examples/avatars/get-browser.md index 8c7c3f2a34..20480ce124 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-browser.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-browser.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-credit-card.md b/docs/examples/1.1.x/console-web/examples/avatars/get-credit-card.md index 219ac51f6b..cdbc4a0067 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-credit-card.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-favicon.md b/docs/examples/1.1.x/console-web/examples/avatars/get-favicon.md index dcd749e7ef..f8db5c378c 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-favicon.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-favicon.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-flag.md b/docs/examples/1.1.x/console-web/examples/avatars/get-flag.md index 22a3cc024f..e609fb299d 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-flag.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-flag.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-image.md b/docs/examples/1.1.x/console-web/examples/avatars/get-image.md index 7b5c024d71..468f6a3c54 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-image.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-image.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-initials.md b/docs/examples/1.1.x/console-web/examples/avatars/get-initials.md index 3a016333c1..d061813297 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-initials.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-initials.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/avatars/get-q-r.md b/docs/examples/1.1.x/console-web/examples/avatars/get-q-r.md index e4cefc4d23..86fed127e9 100644 --- a/docs/examples/1.1.x/console-web/examples/avatars/get-q-r.md +++ b/docs/examples/1.1.x/console-web/examples/avatars/get-q-r.md @@ -1,4 +1,4 @@ -import { Client, Avatars } from "packageName"; +import { Client, Avatars } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-boolean-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-boolean-attribute.md index aea33103a3..b8a2143814 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-boolean-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-boolean-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-collection.md b/docs/examples/1.1.x/console-web/examples/databases/create-collection.md index ab2f5da6e3..d5367d03bc 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-collection.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-collection.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-datetime-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-datetime-attribute.md index d0457e1bd2..a3921bbf2b 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-datetime-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-datetime-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-document.md b/docs/examples/1.1.x/console-web/examples/databases/create-document.md index 94afca4aad..5b8d89ad47 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-document.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-email-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-email-attribute.md index 464eb29f82..50557c0742 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-email-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-email-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-enum-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-enum-attribute.md index 7d418539ca..92e8fae071 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-enum-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-enum-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-float-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-float-attribute.md index 23d346ad52..4c4159f625 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-float-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-float-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-index.md b/docs/examples/1.1.x/console-web/examples/databases/create-index.md index 956a037c99..b706ae69e5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-index.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-index.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-integer-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-integer-attribute.md index 913915b03f..534a61d29b 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-integer-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-integer-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-ip-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-ip-attribute.md index 7014400cf0..9ef9ad780c 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-ip-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-ip-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-string-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-string-attribute.md index 4c4e6f6c16..1553ea92f1 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-string-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-string-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create-url-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/create-url-attribute.md index ac26031f57..8e75affb69 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create-url-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create-url-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/create.md b/docs/examples/1.1.x/console-web/examples/databases/create.md index aedacac821..7936a85aa5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/create.md +++ b/docs/examples/1.1.x/console-web/examples/databases/create.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/delete-attribute.md index d80e5aa16e..8a2ec9b4e5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete-collection.md b/docs/examples/1.1.x/console-web/examples/databases/delete-collection.md index f7b4519d1f..724ae217cf 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete-collection.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete-collection.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete-document.md b/docs/examples/1.1.x/console-web/examples/databases/delete-document.md index 1603c98ca7..e201280445 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete-document.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete-index.md b/docs/examples/1.1.x/console-web/examples/databases/delete-index.md index f28465eb8c..ecd0b48009 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete-index.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete-index.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/delete.md b/docs/examples/1.1.x/console-web/examples/databases/delete.md index 18cea6a280..a625395209 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/delete.md +++ b/docs/examples/1.1.x/console-web/examples/databases/delete.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-attribute.md b/docs/examples/1.1.x/console-web/examples/databases/get-attribute.md index 68fc2b3045..de4352449d 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-attribute.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-attribute.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-collection-usage.md b/docs/examples/1.1.x/console-web/examples/databases/get-collection-usage.md index 834fe83dd5..67fc1702de 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-collection-usage.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-collection-usage.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-collection.md b/docs/examples/1.1.x/console-web/examples/databases/get-collection.md index 91a73990e9..ec069bc3bb 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-collection.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-collection.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-database-usage.md b/docs/examples/1.1.x/console-web/examples/databases/get-database-usage.md index 7a79f193cd..d9cbedcdbb 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-database-usage.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-database-usage.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-document.md b/docs/examples/1.1.x/console-web/examples/databases/get-document.md index 397c1044aa..89314e880a 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-document.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-index.md b/docs/examples/1.1.x/console-web/examples/databases/get-index.md index 34fc88ab6e..ccb19134ef 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-index.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-index.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get-usage.md b/docs/examples/1.1.x/console-web/examples/databases/get-usage.md index dedd2d19ee..9408c58613 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/get.md b/docs/examples/1.1.x/console-web/examples/databases/get.md index f56bbada76..0f376138c5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/get.md +++ b/docs/examples/1.1.x/console-web/examples/databases/get.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-attributes.md b/docs/examples/1.1.x/console-web/examples/databases/list-attributes.md index 1dd98ebad1..22f0df4830 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-attributes.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-attributes.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-collection-logs.md b/docs/examples/1.1.x/console-web/examples/databases/list-collection-logs.md index bf3b774c2a..d8cf623af1 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-collection-logs.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-collection-logs.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-collections.md b/docs/examples/1.1.x/console-web/examples/databases/list-collections.md index f01351a532..5f757022de 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-collections.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-collections.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-document-logs.md b/docs/examples/1.1.x/console-web/examples/databases/list-document-logs.md index 1fde4cddc5..220fb282d5 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-document-logs.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-document-logs.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-documents.md b/docs/examples/1.1.x/console-web/examples/databases/list-documents.md index 6c396a3c4d..a4afd21031 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-documents.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-documents.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-indexes.md b/docs/examples/1.1.x/console-web/examples/databases/list-indexes.md index 46cb061b7f..33dfdd3f7d 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-indexes.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-indexes.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list-logs.md b/docs/examples/1.1.x/console-web/examples/databases/list-logs.md index ad1af2cf87..e9af3195af 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list-logs.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/list.md b/docs/examples/1.1.x/console-web/examples/databases/list.md index 651f5fbdec..44a0fd9436 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/list.md +++ b/docs/examples/1.1.x/console-web/examples/databases/list.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/update-collection.md b/docs/examples/1.1.x/console-web/examples/databases/update-collection.md index 964b8107c9..a46583f436 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/update-collection.md +++ b/docs/examples/1.1.x/console-web/examples/databases/update-collection.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/update-document.md b/docs/examples/1.1.x/console-web/examples/databases/update-document.md index f1bb79da58..2d59a8ad85 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/update-document.md +++ b/docs/examples/1.1.x/console-web/examples/databases/update-document.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/databases/update.md b/docs/examples/1.1.x/console-web/examples/databases/update.md index 7dd37f2a34..3bb577d50b 100644 --- a/docs/examples/1.1.x/console-web/examples/databases/update.md +++ b/docs/examples/1.1.x/console-web/examples/databases/update.md @@ -1,4 +1,4 @@ -import { Client, Databases } from "packageName"; +import { Client, Databases } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create-build.md b/docs/examples/1.1.x/console-web/examples/functions/create-build.md index 80e18f4014..6e99308986 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create-build.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create-build.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create-deployment.md b/docs/examples/1.1.x/console-web/examples/functions/create-deployment.md index 215264f1c4..57687bc535 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create-deployment.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create-deployment.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create-execution.md b/docs/examples/1.1.x/console-web/examples/functions/create-execution.md index 99535d633e..2b64bc9f7b 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create-execution.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create-execution.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create-variable.md b/docs/examples/1.1.x/console-web/examples/functions/create-variable.md index 963828bc1c..972830719e 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create-variable.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create-variable.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/create.md b/docs/examples/1.1.x/console-web/examples/functions/create.md index dac95b2651..4fe6fec973 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/create.md +++ b/docs/examples/1.1.x/console-web/examples/functions/create.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/delete-deployment.md b/docs/examples/1.1.x/console-web/examples/functions/delete-deployment.md index 6722645453..8f2c646401 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/delete-deployment.md +++ b/docs/examples/1.1.x/console-web/examples/functions/delete-deployment.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/delete-variable.md b/docs/examples/1.1.x/console-web/examples/functions/delete-variable.md index 2f1beb7728..5cb80d2106 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/delete-variable.md +++ b/docs/examples/1.1.x/console-web/examples/functions/delete-variable.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/delete.md b/docs/examples/1.1.x/console-web/examples/functions/delete.md index f5f2dcffd0..4ac987df81 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/delete.md +++ b/docs/examples/1.1.x/console-web/examples/functions/delete.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-deployment.md b/docs/examples/1.1.x/console-web/examples/functions/get-deployment.md index 75c63dcc4e..a07fb7e844 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-deployment.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-deployment.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-execution.md b/docs/examples/1.1.x/console-web/examples/functions/get-execution.md index e607477fe2..f5046a08c4 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-execution.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-execution.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-function-usage.md b/docs/examples/1.1.x/console-web/examples/functions/get-function-usage.md index a2c9f48f35..f9d416319f 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-function-usage.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-function-usage.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-usage.md b/docs/examples/1.1.x/console-web/examples/functions/get-usage.md index 5fe6af9a5f..d183a45f19 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get-variable.md b/docs/examples/1.1.x/console-web/examples/functions/get-variable.md index 015211b000..cca9639434 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get-variable.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get-variable.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/get.md b/docs/examples/1.1.x/console-web/examples/functions/get.md index 10c59ab45e..b6e32b5171 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/get.md +++ b/docs/examples/1.1.x/console-web/examples/functions/get.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list-deployments.md b/docs/examples/1.1.x/console-web/examples/functions/list-deployments.md index ef81eafb2e..843dd07a61 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list-deployments.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list-deployments.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list-executions.md b/docs/examples/1.1.x/console-web/examples/functions/list-executions.md index bcf2a7a48d..99186a95de 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list-executions.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list-executions.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list-runtimes.md b/docs/examples/1.1.x/console-web/examples/functions/list-runtimes.md index ff37c68866..d5e1f6630e 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list-runtimes.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list-runtimes.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list-variables.md b/docs/examples/1.1.x/console-web/examples/functions/list-variables.md index f6ab0863c4..9461ce60f0 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list-variables.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list-variables.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/list.md b/docs/examples/1.1.x/console-web/examples/functions/list.md index dab9a8ab28..730a90fff6 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/list.md +++ b/docs/examples/1.1.x/console-web/examples/functions/list.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/update-deployment.md b/docs/examples/1.1.x/console-web/examples/functions/update-deployment.md index 80f0d5b3ae..b231ae593e 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/update-deployment.md +++ b/docs/examples/1.1.x/console-web/examples/functions/update-deployment.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/update-variable.md b/docs/examples/1.1.x/console-web/examples/functions/update-variable.md index b09485f35b..b3f0439644 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/update-variable.md +++ b/docs/examples/1.1.x/console-web/examples/functions/update-variable.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/functions/update.md b/docs/examples/1.1.x/console-web/examples/functions/update.md index b67bf06d6e..c025fc73a7 100644 --- a/docs/examples/1.1.x/console-web/examples/functions/update.md +++ b/docs/examples/1.1.x/console-web/examples/functions/update.md @@ -1,4 +1,4 @@ -import { Client, Functions } from "packageName"; +import { Client, Functions } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-antivirus.md b/docs/examples/1.1.x/console-web/examples/health/get-antivirus.md index 7211653832..0b14fa8acf 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-antivirus.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-antivirus.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-cache.md b/docs/examples/1.1.x/console-web/examples/health/get-cache.md index a8dadc1a94..a754f9be93 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-cache.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-cache.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-d-b.md b/docs/examples/1.1.x/console-web/examples/health/get-d-b.md index b92facbdb9..86ff4a7d84 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-d-b.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-d-b.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-queue-certificates.md b/docs/examples/1.1.x/console-web/examples/health/get-queue-certificates.md index b9d3bf42c7..2b4dc05c37 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-queue-certificates.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-queue-certificates.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-queue-functions.md b/docs/examples/1.1.x/console-web/examples/health/get-queue-functions.md index 0cae096727..9d6f3b7f7d 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-queue-functions.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-queue-functions.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-queue-logs.md b/docs/examples/1.1.x/console-web/examples/health/get-queue-logs.md index a2909db719..010e603f92 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-queue-logs.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-queue-logs.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-queue-webhooks.md b/docs/examples/1.1.x/console-web/examples/health/get-queue-webhooks.md index 4e46c69a85..2687863f12 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-queue-webhooks.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-queue-webhooks.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-storage-local.md b/docs/examples/1.1.x/console-web/examples/health/get-storage-local.md index 9d43db36c1..b11daa2fec 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-storage-local.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-storage-local.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get-time.md b/docs/examples/1.1.x/console-web/examples/health/get-time.md index 20314ef83e..1f617e13a2 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get-time.md +++ b/docs/examples/1.1.x/console-web/examples/health/get-time.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/health/get.md b/docs/examples/1.1.x/console-web/examples/health/get.md index 3add8a3f09..b1d6be4509 100644 --- a/docs/examples/1.1.x/console-web/examples/health/get.md +++ b/docs/examples/1.1.x/console-web/examples/health/get.md @@ -1,4 +1,4 @@ -import { Client, Health } from "packageName"; +import { Client, Health } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/get.md b/docs/examples/1.1.x/console-web/examples/locale/get.md index f952603a8a..634256c83e 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/get.md +++ b/docs/examples/1.1.x/console-web/examples/locale/get.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-continents.md b/docs/examples/1.1.x/console-web/examples/locale/list-continents.md index 7df98f8862..e79a8eab5c 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-continents.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-continents.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-countries-e-u.md b/docs/examples/1.1.x/console-web/examples/locale/list-countries-e-u.md index 8a26c02bd3..964bed390b 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-countries-e-u.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-countries-phones.md b/docs/examples/1.1.x/console-web/examples/locale/list-countries-phones.md index c1b9c48b55..65ec4f4dbd 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-countries-phones.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-countries.md b/docs/examples/1.1.x/console-web/examples/locale/list-countries.md index 8ef34dc6d9..6b7e8e665f 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-countries.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-countries.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-currencies.md b/docs/examples/1.1.x/console-web/examples/locale/list-currencies.md index 80efe589c7..3638c2e1bb 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-currencies.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-currencies.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/locale/list-languages.md b/docs/examples/1.1.x/console-web/examples/locale/list-languages.md index 3c1253e4c5..bffa5eb0c6 100644 --- a/docs/examples/1.1.x/console-web/examples/locale/list-languages.md +++ b/docs/examples/1.1.x/console-web/examples/locale/list-languages.md @@ -1,4 +1,4 @@ -import { Client, Locale } from "packageName"; +import { Client, Locale } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create-domain.md b/docs/examples/1.1.x/console-web/examples/projects/create-domain.md index 496663b38d..452a594c48 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create-domain.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create-domain.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create-key.md b/docs/examples/1.1.x/console-web/examples/projects/create-key.md index 1a962d872a..8bd57d54c6 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create-key.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create-key.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create-platform.md b/docs/examples/1.1.x/console-web/examples/projects/create-platform.md index 1160a7c8b3..c2c6a030b4 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create-platform.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create-platform.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create-webhook.md b/docs/examples/1.1.x/console-web/examples/projects/create-webhook.md index 2ace893691..1469e6b30f 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create-webhook.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create-webhook.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/create.md b/docs/examples/1.1.x/console-web/examples/projects/create.md index 74871c1eb7..940b998324 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/create.md +++ b/docs/examples/1.1.x/console-web/examples/projects/create.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete-domain.md b/docs/examples/1.1.x/console-web/examples/projects/delete-domain.md index a148b76460..266d343ae1 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete-domain.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete-domain.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete-key.md b/docs/examples/1.1.x/console-web/examples/projects/delete-key.md index b002255793..0b227e7f1a 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete-key.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete-key.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete-platform.md b/docs/examples/1.1.x/console-web/examples/projects/delete-platform.md index b25c7c0e55..681362017c 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete-platform.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete-platform.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete-webhook.md b/docs/examples/1.1.x/console-web/examples/projects/delete-webhook.md index a4466114f1..3edbdadb07 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete-webhook.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete-webhook.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/delete.md b/docs/examples/1.1.x/console-web/examples/projects/delete.md index b6373978f7..1e479709e9 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/delete.md +++ b/docs/examples/1.1.x/console-web/examples/projects/delete.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-domain.md b/docs/examples/1.1.x/console-web/examples/projects/get-domain.md index dee059f324..a90d5eec33 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-domain.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-domain.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-key.md b/docs/examples/1.1.x/console-web/examples/projects/get-key.md index 1120e0942a..59a4224f78 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-key.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-key.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-platform.md b/docs/examples/1.1.x/console-web/examples/projects/get-platform.md index 5361652cdb..8eaea3371b 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-platform.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-platform.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-usage.md b/docs/examples/1.1.x/console-web/examples/projects/get-usage.md index da49cb704a..be7ee4379e 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get-webhook.md b/docs/examples/1.1.x/console-web/examples/projects/get-webhook.md index 78a992de46..b636a797ee 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get-webhook.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get-webhook.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/get.md b/docs/examples/1.1.x/console-web/examples/projects/get.md index 1b6d3845bc..ac20f56023 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/get.md +++ b/docs/examples/1.1.x/console-web/examples/projects/get.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list-domains.md b/docs/examples/1.1.x/console-web/examples/projects/list-domains.md index 375d2ba650..2c4a7415d2 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list-domains.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list-domains.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list-keys.md b/docs/examples/1.1.x/console-web/examples/projects/list-keys.md index 4ad7c21a2a..957531a892 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list-keys.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list-keys.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list-platforms.md b/docs/examples/1.1.x/console-web/examples/projects/list-platforms.md index ae2bd8ae45..100be04115 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list-platforms.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list-platforms.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list-webhooks.md b/docs/examples/1.1.x/console-web/examples/projects/list-webhooks.md index 096d62bf50..093b9e91f7 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list-webhooks.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list-webhooks.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/list.md b/docs/examples/1.1.x/console-web/examples/projects/list.md index a870d95af5..a576843401 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/list.md +++ b/docs/examples/1.1.x/console-web/examples/projects/list.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-auth-duration.md b/docs/examples/1.1.x/console-web/examples/projects/update-auth-duration.md index df3b479631..ab7b01084c 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-auth-duration.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-auth-duration.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-auth-limit.md b/docs/examples/1.1.x/console-web/examples/projects/update-auth-limit.md index 72a2452cb2..7cc850ad2e 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-auth-limit.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-auth-limit.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-auth-status.md b/docs/examples/1.1.x/console-web/examples/projects/update-auth-status.md index 6330048f96..400d5a4f7b 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-auth-status.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-auth-status.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-domain-verification.md b/docs/examples/1.1.x/console-web/examples/projects/update-domain-verification.md index 055b8d8153..c632ad10fb 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-domain-verification.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-domain-verification.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-key.md b/docs/examples/1.1.x/console-web/examples/projects/update-key.md index ef071795d7..627bf6c38b 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-key.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-key.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-o-auth2.md b/docs/examples/1.1.x/console-web/examples/projects/update-o-auth2.md index c4ac006689..df22de53d3 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-o-auth2.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-o-auth2.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-platform.md b/docs/examples/1.1.x/console-web/examples/projects/update-platform.md index f2d97a5951..0d6b91999e 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-platform.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-platform.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-service-status.md b/docs/examples/1.1.x/console-web/examples/projects/update-service-status.md index b9613b08eb..ae95091908 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-service-status.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-service-status.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-webhook-signature.md b/docs/examples/1.1.x/console-web/examples/projects/update-webhook-signature.md index 534ab66532..3545f9a50a 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-webhook-signature.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-webhook-signature.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update-webhook.md b/docs/examples/1.1.x/console-web/examples/projects/update-webhook.md index dc94675a17..45ecb8b02d 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update-webhook.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update-webhook.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/projects/update.md b/docs/examples/1.1.x/console-web/examples/projects/update.md index ccc594f390..661eb11920 100644 --- a/docs/examples/1.1.x/console-web/examples/projects/update.md +++ b/docs/examples/1.1.x/console-web/examples/projects/update.md @@ -1,4 +1,4 @@ -import { Client, Projects } from "packageName"; +import { Client, Projects } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/create-bucket.md b/docs/examples/1.1.x/console-web/examples/storage/create-bucket.md index 194f8980b2..e2c8bb3c5d 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/create-bucket.md +++ b/docs/examples/1.1.x/console-web/examples/storage/create-bucket.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/create-file.md b/docs/examples/1.1.x/console-web/examples/storage/create-file.md index 710adbade3..10992d2b89 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/create-file.md +++ b/docs/examples/1.1.x/console-web/examples/storage/create-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/delete-bucket.md b/docs/examples/1.1.x/console-web/examples/storage/delete-bucket.md index e50ec3be46..a8580f9a08 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/delete-bucket.md +++ b/docs/examples/1.1.x/console-web/examples/storage/delete-bucket.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/delete-file.md b/docs/examples/1.1.x/console-web/examples/storage/delete-file.md index 7b5ecaa599..4512a8c1ce 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/delete-file.md +++ b/docs/examples/1.1.x/console-web/examples/storage/delete-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-bucket-usage.md b/docs/examples/1.1.x/console-web/examples/storage/get-bucket-usage.md index c2a372e961..61ef7fa956 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-bucket-usage.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-bucket-usage.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-bucket.md b/docs/examples/1.1.x/console-web/examples/storage/get-bucket.md index 425bebabc1..3ffd9f3b42 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-bucket.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-bucket.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-file-download.md b/docs/examples/1.1.x/console-web/examples/storage/get-file-download.md index 0fdd3c5614..17c06600b3 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-file-download.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-file-download.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-file-preview.md b/docs/examples/1.1.x/console-web/examples/storage/get-file-preview.md index 262cd023bf..52866d108a 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-file-preview.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-file-preview.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-file-view.md b/docs/examples/1.1.x/console-web/examples/storage/get-file-view.md index bae90e9d31..7bb6c67d51 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-file-view.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-file-view.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-file.md b/docs/examples/1.1.x/console-web/examples/storage/get-file.md index 3f6741a5e3..3263865c73 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-file.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/get-usage.md b/docs/examples/1.1.x/console-web/examples/storage/get-usage.md index 5dff8f3776..a5ce5853e9 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/storage/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/list-buckets.md b/docs/examples/1.1.x/console-web/examples/storage/list-buckets.md index d3373c5474..4f916c1536 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/list-buckets.md +++ b/docs/examples/1.1.x/console-web/examples/storage/list-buckets.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/list-files.md b/docs/examples/1.1.x/console-web/examples/storage/list-files.md index 7868a925f6..92d75742a5 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/list-files.md +++ b/docs/examples/1.1.x/console-web/examples/storage/list-files.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/update-bucket.md b/docs/examples/1.1.x/console-web/examples/storage/update-bucket.md index b4e866ac3f..c0b6b41fab 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/update-bucket.md +++ b/docs/examples/1.1.x/console-web/examples/storage/update-bucket.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/storage/update-file.md b/docs/examples/1.1.x/console-web/examples/storage/update-file.md index 8f3e2484f8..1313e30cff 100644 --- a/docs/examples/1.1.x/console-web/examples/storage/update-file.md +++ b/docs/examples/1.1.x/console-web/examples/storage/update-file.md @@ -1,4 +1,4 @@ -import { Client, Storage } from "packageName"; +import { Client, Storage } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/create-membership.md b/docs/examples/1.1.x/console-web/examples/teams/create-membership.md index 005980871a..6cb7d87b7f 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/create-membership.md +++ b/docs/examples/1.1.x/console-web/examples/teams/create-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/create.md b/docs/examples/1.1.x/console-web/examples/teams/create.md index 2879eaa6ae..2c40c9017d 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/create.md +++ b/docs/examples/1.1.x/console-web/examples/teams/create.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/delete-membership.md b/docs/examples/1.1.x/console-web/examples/teams/delete-membership.md index 3275878b9b..828674a86f 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/delete-membership.md +++ b/docs/examples/1.1.x/console-web/examples/teams/delete-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/delete.md b/docs/examples/1.1.x/console-web/examples/teams/delete.md index 806ef8f60e..b9b79ed1b7 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/delete.md +++ b/docs/examples/1.1.x/console-web/examples/teams/delete.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/get-membership.md b/docs/examples/1.1.x/console-web/examples/teams/get-membership.md index aa583b3e12..cce63e7fba 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/get-membership.md +++ b/docs/examples/1.1.x/console-web/examples/teams/get-membership.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/get.md b/docs/examples/1.1.x/console-web/examples/teams/get.md index cfcafefc03..3a7185319a 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/get.md +++ b/docs/examples/1.1.x/console-web/examples/teams/get.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/list-logs.md b/docs/examples/1.1.x/console-web/examples/teams/list-logs.md index 0e1f7c7e9c..f5120d5b21 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/list-logs.md +++ b/docs/examples/1.1.x/console-web/examples/teams/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/list-memberships.md b/docs/examples/1.1.x/console-web/examples/teams/list-memberships.md index b507f82e92..12bef1a6f8 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/list-memberships.md +++ b/docs/examples/1.1.x/console-web/examples/teams/list-memberships.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/list.md b/docs/examples/1.1.x/console-web/examples/teams/list.md index 2333ab4155..1aea267038 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/list.md +++ b/docs/examples/1.1.x/console-web/examples/teams/list.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/update-membership-roles.md b/docs/examples/1.1.x/console-web/examples/teams/update-membership-roles.md index e5ab84867e..ca76ead1d6 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/console-web/examples/teams/update-membership-roles.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/update-membership-status.md b/docs/examples/1.1.x/console-web/examples/teams/update-membership-status.md index fdd391ca22..4a29cdc116 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/update-membership-status.md +++ b/docs/examples/1.1.x/console-web/examples/teams/update-membership-status.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/teams/update.md b/docs/examples/1.1.x/console-web/examples/teams/update.md index ce54a850d8..a59cc80000 100644 --- a/docs/examples/1.1.x/console-web/examples/teams/update.md +++ b/docs/examples/1.1.x/console-web/examples/teams/update.md @@ -1,4 +1,4 @@ -import { Client, Teams } from "packageName"; +import { Client, Teams } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-argon2user.md b/docs/examples/1.1.x/console-web/examples/users/create-argon2user.md index 68d41eec7d..e63f9cc083 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-argon2user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-argon2user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-bcrypt-user.md b/docs/examples/1.1.x/console-web/examples/users/create-bcrypt-user.md index 670119c1ef..615ebcd8db 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-bcrypt-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-bcrypt-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-m-d5user.md b/docs/examples/1.1.x/console-web/examples/users/create-m-d5user.md index a4e39d84e8..75778f0c66 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-m-d5user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-m-d5user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-p-h-pass-user.md b/docs/examples/1.1.x/console-web/examples/users/create-p-h-pass-user.md index cdf83907be..054ae92691 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-p-h-pass-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-p-h-pass-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-s-h-a-user.md b/docs/examples/1.1.x/console-web/examples/users/create-s-h-a-user.md index 3f0d2b95fb..1213596592 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-s-h-a-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-s-h-a-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-scrypt-modified-user.md b/docs/examples/1.1.x/console-web/examples/users/create-scrypt-modified-user.md index 14c8cb2f1e..de022f1aa1 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-scrypt-modified-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create-scrypt-user.md b/docs/examples/1.1.x/console-web/examples/users/create-scrypt-user.md index ed479f70a7..a6050acfcb 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create-scrypt-user.md +++ b/docs/examples/1.1.x/console-web/examples/users/create-scrypt-user.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/create.md b/docs/examples/1.1.x/console-web/examples/users/create.md index bb62b1531f..7c9644702c 100644 --- a/docs/examples/1.1.x/console-web/examples/users/create.md +++ b/docs/examples/1.1.x/console-web/examples/users/create.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/delete-session.md b/docs/examples/1.1.x/console-web/examples/users/delete-session.md index 3be7607a66..90f0f301ff 100644 --- a/docs/examples/1.1.x/console-web/examples/users/delete-session.md +++ b/docs/examples/1.1.x/console-web/examples/users/delete-session.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/delete-sessions.md b/docs/examples/1.1.x/console-web/examples/users/delete-sessions.md index f930ce40c6..3df8c7bdb6 100644 --- a/docs/examples/1.1.x/console-web/examples/users/delete-sessions.md +++ b/docs/examples/1.1.x/console-web/examples/users/delete-sessions.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/delete.md b/docs/examples/1.1.x/console-web/examples/users/delete.md index 51690fbd31..f7c21f3d55 100644 --- a/docs/examples/1.1.x/console-web/examples/users/delete.md +++ b/docs/examples/1.1.x/console-web/examples/users/delete.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/get-prefs.md b/docs/examples/1.1.x/console-web/examples/users/get-prefs.md index 8bd1a3185f..959c68c7c0 100644 --- a/docs/examples/1.1.x/console-web/examples/users/get-prefs.md +++ b/docs/examples/1.1.x/console-web/examples/users/get-prefs.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/get-usage.md b/docs/examples/1.1.x/console-web/examples/users/get-usage.md index b1694fd826..cca80da32d 100644 --- a/docs/examples/1.1.x/console-web/examples/users/get-usage.md +++ b/docs/examples/1.1.x/console-web/examples/users/get-usage.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/get.md b/docs/examples/1.1.x/console-web/examples/users/get.md index 497c9dfe15..500263dad6 100644 --- a/docs/examples/1.1.x/console-web/examples/users/get.md +++ b/docs/examples/1.1.x/console-web/examples/users/get.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/list-logs.md b/docs/examples/1.1.x/console-web/examples/users/list-logs.md index ece696c12d..9b2d31d95b 100644 --- a/docs/examples/1.1.x/console-web/examples/users/list-logs.md +++ b/docs/examples/1.1.x/console-web/examples/users/list-logs.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/list-memberships.md b/docs/examples/1.1.x/console-web/examples/users/list-memberships.md index 657801b997..ebd6a38e42 100644 --- a/docs/examples/1.1.x/console-web/examples/users/list-memberships.md +++ b/docs/examples/1.1.x/console-web/examples/users/list-memberships.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/list-sessions.md b/docs/examples/1.1.x/console-web/examples/users/list-sessions.md index 1bb7b88461..c932d6fee7 100644 --- a/docs/examples/1.1.x/console-web/examples/users/list-sessions.md +++ b/docs/examples/1.1.x/console-web/examples/users/list-sessions.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/list.md b/docs/examples/1.1.x/console-web/examples/users/list.md index 9640b5dfcb..49838da24d 100644 --- a/docs/examples/1.1.x/console-web/examples/users/list.md +++ b/docs/examples/1.1.x/console-web/examples/users/list.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-email-verification.md b/docs/examples/1.1.x/console-web/examples/users/update-email-verification.md index bdaa78563e..2abfff8244 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-email-verification.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-email-verification.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-email.md b/docs/examples/1.1.x/console-web/examples/users/update-email.md index 516394bf08..c0427ac6af 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-email.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-email.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-name.md b/docs/examples/1.1.x/console-web/examples/users/update-name.md index 9e7cecd6a3..ed13672a5c 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-name.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-name.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-password.md b/docs/examples/1.1.x/console-web/examples/users/update-password.md index 5e9c314b12..e13d9bcafa 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-password.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-password.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-phone-verification.md b/docs/examples/1.1.x/console-web/examples/users/update-phone-verification.md index c7f7801fa2..63edc56cab 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-phone-verification.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-phone-verification.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-phone.md b/docs/examples/1.1.x/console-web/examples/users/update-phone.md index 1174f55c42..502bb040fb 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-phone.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-phone.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-prefs.md b/docs/examples/1.1.x/console-web/examples/users/update-prefs.md index 465e6046f2..d1d0a8b1ec 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-prefs.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-prefs.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/console-web/examples/users/update-status.md b/docs/examples/1.1.x/console-web/examples/users/update-status.md index 9082abcffb..189cbca6d4 100644 --- a/docs/examples/1.1.x/console-web/examples/users/update-status.md +++ b/docs/examples/1.1.x/console-web/examples/users/update-status.md @@ -1,4 +1,4 @@ -import { Client, Users } from "packageName"; +import { Client, Users } from "appwrite"; const client = new Client(); diff --git a/docs/examples/1.1.x/server-kotlin/java/account/create-phone-verification.md b/docs/examples/1.1.x/server-kotlin/java/account/create-phone-verification.md index 949a3c764b..08e28ee63e 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/create-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/create-phone-verification.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.createPhoneVerification(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.createPhoneVerification(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/create-recovery.md b/docs/examples/1.1.x/server-kotlin/java/account/create-recovery.md index 07bb13584c..83fbe91a95 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/create-recovery.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/create-recovery.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.createRecovery( + email = "email@example.com", + url = "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.createRecovery( - "email@example.com", - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/create-verification.md b/docs/examples/1.1.x/server-kotlin/java/account/create-verification.md index 15d8e4d9cd..2ca770e2e1 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/create-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/create-verification.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.createVerification( + url = "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.createVerification( - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/delete-session.md b/docs/examples/1.1.x/server-kotlin/java/account/delete-session.md index ea3f899f9c..bb925a77e3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/delete-session.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/delete-session.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.deleteSession( + sessionId = "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.deleteSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/delete-sessions.md b/docs/examples/1.1.x/server-kotlin/java/account/delete-sessions.md index 8916b85a22..4cda782b99 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/delete-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/delete-sessions.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.deleteSessions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.deleteSessions(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/get-prefs.md b/docs/examples/1.1.x/server-kotlin/java/account/get-prefs.md index de285877ad..501e2d08c7 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/get-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/get-prefs.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.getPrefs(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.getPrefs(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/get-session.md b/docs/examples/1.1.x/server-kotlin/java/account/get-session.md index 77b7767a43..6f3e9e1a82 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/get-session.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/get-session.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.getSession( + sessionId = "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.getSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/get.md b/docs/examples/1.1.x/server-kotlin/java/account/get.md index 48db0498fb..2429a5d5d9 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/get.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.get(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/list-logs.md b/docs/examples/1.1.x/server-kotlin/java/account/list-logs.md index 65f3b206da..a44e64a3c3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/list-logs.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/list-logs.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.listLogs( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.listLogs( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/list-sessions.md b/docs/examples/1.1.x/server-kotlin/java/account/list-sessions.md index 5294d417bd..41b66ce275 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/list-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/list-sessions.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.listSessions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.listSessions(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-email.md b/docs/examples/1.1.x/server-kotlin/java/account/update-email.md index 4629a17baf..187fa22e2d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-email.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-email.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateEmail( + email = "email@example.com", + password = "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateEmail( - "email@example.com", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-name.md b/docs/examples/1.1.x/server-kotlin/java/account/update-name.md index 4c0579a693..6f15d10e41 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-name.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-name.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateName( + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateName( - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-password.md b/docs/examples/1.1.x/server-kotlin/java/account/update-password.md index 03c5feb54f..5058503b4c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-password.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-password.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updatePassword( + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updatePassword( - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-phone-verification.md b/docs/examples/1.1.x/server-kotlin/java/account/update-phone-verification.md index 2169a61b46..d4716c1173 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-phone-verification.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updatePhoneVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updatePhoneVerification( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-phone.md b/docs/examples/1.1.x/server-kotlin/java/account/update-phone.md index 1b56b7bdb8..40af863e76 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-phone.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-phone.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updatePhone( + phone = "+12065550100", + password = "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updatePhone( - "+12065550100", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-prefs.md b/docs/examples/1.1.x/server-kotlin/java/account/update-prefs.md index ad31ace473..ca085e904c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-prefs.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updatePrefs( + prefs = mapOf( "a" to "b" ) + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updatePrefs( - mapOf( "a" to "b" ) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-recovery.md b/docs/examples/1.1.x/server-kotlin/java/account/update-recovery.md index 94f9216af7..d2b79d3dc5 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-recovery.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-recovery.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateRecovery( + userId = "[USER_ID]", + secret = "[SECRET]", + password = "password", + passwordAgain = "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateRecovery( - "[USER_ID]", - "[SECRET]", - "password", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-session.md b/docs/examples/1.1.x/server-kotlin/java/account/update-session.md index a093bf6f4a..4e41fbb4e1 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-session.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-session.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateSession( + sessionId = "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateSession( - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-status.md b/docs/examples/1.1.x/server-kotlin/java/account/update-status.md index 1f296b9260..6a8e86649f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-status.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-status.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateStatus(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateStatus(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/account/update-verification.md b/docs/examples/1.1.x/server-kotlin/java/account/update-verification.md index e5177dc470..0c0eb6c962 100644 --- a/docs/examples/1.1.x/server-kotlin/java/account/update-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/account/update-verification.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Account; +import io.appwrite.Client +import io.appwrite.services.Account -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Account account = new Account(client); + Account account = new Account(client); + account.updateVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -account.updateVerification( - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-browser.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-browser.md index 279f1cb84c..3042e77002 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-browser.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-browser.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getBrowser( + code = "aa", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getBrowser( - "aa", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-credit-card.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-credit-card.md index 750de69986..956f6b76f3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-credit-card.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getCreditCard( + code = "amex", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getCreditCard( - "amex", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-favicon.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-favicon.md index be2418fd08..35b64fcc0b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-favicon.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-favicon.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getFavicon( + url = "https://example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getFavicon( - "https://example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-flag.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-flag.md index 3424345797..ccc90df1e6 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-flag.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-flag.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getFlag( + code = "af", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getFlag( - "af", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-image.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-image.md index 8c8a5cf092..357f6bf29c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-image.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-image.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getImage( + url = "https://example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getImage( - "https://example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-initials.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-initials.md index 345a7e70d8..c6ef8ce8e7 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-initials.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-initials.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getInitials( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getInitials( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/avatars/get-q-r.md b/docs/examples/1.1.x/server-kotlin/java/avatars/get-q-r.md index c72eb271dd..07031b38ce 100644 --- a/docs/examples/1.1.x/server-kotlin/java/avatars/get-q-r.md +++ b/docs/examples/1.1.x/server-kotlin/java/avatars/get-q-r.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Avatars; +import io.appwrite.Client +import io.appwrite.services.Avatars -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Avatars avatars = new Avatars(client); + Avatars avatars = new Avatars(client); + avatars.getQR( + text = "[TEXT]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -avatars.getQR( - "[TEXT]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-boolean-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-boolean-attribute.md index 9a44dc27cc..008e47a493 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-boolean-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-boolean-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createBooleanAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createBooleanAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-collection.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-collection.md index 6e14c4d214..64b2eca6d0 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-collection.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-collection.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createCollection( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-datetime-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-datetime-attribute.md index 27d5493df1..29d4f1d2ab 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-datetime-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-datetime-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createDatetimeAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createDatetimeAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-document.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-document.md index 5ee69e0512..58819ea4a8 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-document.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-document.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + data = mapOf( "a" to "b" ), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - mapOf( "a" to "b" ), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-email-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-email-attribute.md index bf6e60aa9e..3c79d0bb84 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-email-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-email-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createEmailAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createEmailAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-enum-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-enum-attribute.md index b70ec29ed7..4c58948fbb 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-enum-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-enum-attribute.md @@ -1,26 +1,40 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createEnumAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + elements = listOf(), + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createEnumAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - listOf(), - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-float-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-float-attribute.md index 9c4d60b5a1..0af11fc86b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-float-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-float-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createFloatAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createFloatAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-index.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-index.md index c396a7c462..4b78ce1ed2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-index.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-index.md @@ -1,26 +1,40 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + type = "key", + attributes = listOf(), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createIndex( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - "key", - listOf(), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-integer-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-integer-attribute.md index 86d9bca83a..f6cb49c8dc 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-integer-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-integer-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createIntegerAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createIntegerAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-ip-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-ip-attribute.md index 0fbc87f895..a2c0cd403b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-ip-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-ip-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createIpAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createIpAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-string-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-string-attribute.md index 65bfab776b..8f782ad615 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-string-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-string-attribute.md @@ -1,26 +1,40 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createStringAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + size = 1, + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createStringAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - 1, - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create-url-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/create-url-attribute.md index 1427fee591..09366afc78 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create-url-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create-url-attribute.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.createUrlAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.createUrlAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "", - false, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/create.md b/docs/examples/1.1.x/server-kotlin/java/databases/create.md index ed74fbea0f..e968a53517 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/create.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/create.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.create( + databaseId = "[DATABASE_ID]", + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.create( - "[DATABASE_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete-attribute.md index 1961089145..b8843ac7ce 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete-attribute.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.deleteAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.deleteAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete-collection.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete-collection.md index bbd6f053e0..e4c999a2af 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete-collection.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete-collection.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.deleteCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.deleteCollection( - "[DATABASE_ID]", - "[COLLECTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete-document.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete-document.md index fa9c8f4bee..71ba4ca7ba 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete-document.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete-document.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.deleteDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.deleteDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete-index.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete-index.md index 83fcd65784..446db766a2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete-index.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete-index.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.deleteIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.deleteIndex( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/delete.md b/docs/examples/1.1.x/server-kotlin/java/databases/delete.md index 3096ae819f..94c4c30b78 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/delete.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/delete.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.delete( + databaseId = "[DATABASE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.delete( - "[DATABASE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get-attribute.md b/docs/examples/1.1.x/server-kotlin/java/databases/get-attribute.md index bff6826a3c..9be9a32889 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get-attribute.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.getAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.getAttribute( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get-collection.md b/docs/examples/1.1.x/server-kotlin/java/databases/get-collection.md index ccfe466236..76e0f796a3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get-collection.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get-collection.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.getCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.getCollection( - "[DATABASE_ID]", - "[COLLECTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get-document.md b/docs/examples/1.1.x/server-kotlin/java/databases/get-document.md index 5461088f85..e5bab16f18 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get-document.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get-document.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.getDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.getDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get-index.md b/docs/examples/1.1.x/server-kotlin/java/databases/get-index.md index 71b6363077..baea8e4011 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get-index.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get-index.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.getIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.getIndex( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/get.md b/docs/examples/1.1.x/server-kotlin/java/databases/get.md index 41032825b2..37a3d6d51f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/get.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.get( + databaseId = "[DATABASE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.get( - "[DATABASE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list-attributes.md b/docs/examples/1.1.x/server-kotlin/java/databases/list-attributes.md index b9bd7baab1..fbe5fde77a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list-attributes.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list-attributes.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.listAttributes( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.listAttributes( - "[DATABASE_ID]", - "[COLLECTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list-collections.md b/docs/examples/1.1.x/server-kotlin/java/databases/list-collections.md index 07b84560d3..63cfae49e2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list-collections.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list-collections.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.listCollections( + databaseId = "[DATABASE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.listCollections( - "[DATABASE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list-documents.md b/docs/examples/1.1.x/server-kotlin/java/databases/list-documents.md index 4971b99f6a..03b237bba2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list-documents.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list-documents.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.listDocuments( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.listDocuments( - "[DATABASE_ID]", - "[COLLECTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list-indexes.md b/docs/examples/1.1.x/server-kotlin/java/databases/list-indexes.md index 03eeb3f73d..419d118fd7 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list-indexes.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list-indexes.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.listIndexes( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.listIndexes( - "[DATABASE_ID]", - "[COLLECTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/list.md b/docs/examples/1.1.x/server-kotlin/java/databases/list.md index fe351bc3a3..cbd316eb0f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/list.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/list.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/update-collection.md b/docs/examples/1.1.x/server-kotlin/java/databases/update-collection.md index a9fe045f71..d8d7e16dee 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/update-collection.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/update-collection.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.updateCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.updateCollection( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/update-document.md b/docs/examples/1.1.x/server-kotlin/java/databases/update-document.md index 24a20dc8c6..93868d2896 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/update-document.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/update-document.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.updateDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.updateDocument( - "[DATABASE_ID]", - "[COLLECTION_ID]", - "[DOCUMENT_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/databases/update.md b/docs/examples/1.1.x/server-kotlin/java/databases/update.md index d48903f4d4..43cfce388c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/databases/update.md +++ b/docs/examples/1.1.x/server-kotlin/java/databases/update.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Databases; +import io.appwrite.Client +import io.appwrite.services.Databases -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Databases databases = new Databases(client); + Databases databases = new Databases(client); + databases.update( + databaseId = "[DATABASE_ID]", + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -databases.update( - "[DATABASE_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create-build.md b/docs/examples/1.1.x/server-kotlin/java/functions/create-build.md index eba921e980..5b1853df0d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create-build.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create-build.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.createBuild( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]", + buildId = "[BUILD_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.createBuild( - "[FUNCTION_ID]", - "[DEPLOYMENT_ID]", - "[BUILD_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create-deployment.md b/docs/examples/1.1.x/server-kotlin/java/functions/create-deployment.md index 1003c6e7e6..bd8a4606cc 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create-deployment.md @@ -1,26 +1,40 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.models.InputFile; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.models.InputFile +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.createDeployment( + functionId = "[FUNCTION_ID]", + entrypoint = "[ENTRYPOINT]", + code = InputFile.fromPath("file.png"), + activate = false + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.createDeployment( - "[FUNCTION_ID]", - "[ENTRYPOINT]", - InputFile.fromPath("file.png"), - false - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create-execution.md b/docs/examples/1.1.x/server-kotlin/java/functions/create-execution.md index dc89de5bb1..eb13aed5c3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create-execution.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create-execution.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.createExecution( + functionId = "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.createExecution( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create-variable.md b/docs/examples/1.1.x/server-kotlin/java/functions/create-variable.md index 5791205ec5..08e572f2b1 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create-variable.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create-variable.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.createVariable( + functionId = "[FUNCTION_ID]", + key = "[KEY]", + value = "[VALUE]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.createVariable( - "[FUNCTION_ID]", - "[KEY]", - "[VALUE]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/create.md b/docs/examples/1.1.x/server-kotlin/java/functions/create.md index aac8c64fb1..9448fde2de 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/create.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/create.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.create( + functionId = "[FUNCTION_ID]", + name = "[NAME]", + execute = listOf("any"), + runtime = "node-14.5", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.create( - "[FUNCTION_ID]", - "[NAME]", - listOf("any"), - "node-14.5", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/delete-deployment.md b/docs/examples/1.1.x/server-kotlin/java/functions/delete-deployment.md index 9a34fa352e..58fbc7cfee 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/delete-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/delete-deployment.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.deleteDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.deleteDeployment( - "[FUNCTION_ID]", - "[DEPLOYMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/delete-variable.md b/docs/examples/1.1.x/server-kotlin/java/functions/delete-variable.md index f55e5f0012..bcb93dd391 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/delete-variable.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/delete-variable.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.deleteVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.deleteVariable( - "[FUNCTION_ID]", - "[VARIABLE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/delete.md b/docs/examples/1.1.x/server-kotlin/java/functions/delete.md index d006a13176..a51709b874 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/delete.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/delete.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.delete( + functionId = "[FUNCTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.delete( - "[FUNCTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/get-deployment.md b/docs/examples/1.1.x/server-kotlin/java/functions/get-deployment.md index 0d0651cf57..276e711bba 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/get-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/get-deployment.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.getDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.getDeployment( - "[FUNCTION_ID]", - "[DEPLOYMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/get-execution.md b/docs/examples/1.1.x/server-kotlin/java/functions/get-execution.md index b8b9b66fad..4161b28eaf 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/get-execution.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/get-execution.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.getExecution( + functionId = "[FUNCTION_ID]", + executionId = "[EXECUTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.getExecution( - "[FUNCTION_ID]", - "[EXECUTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/get-variable.md b/docs/examples/1.1.x/server-kotlin/java/functions/get-variable.md index 7d6320cb30..b6b77c23dc 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/get-variable.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/get-variable.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.getVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.getVariable( - "[FUNCTION_ID]", - "[VARIABLE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/get.md b/docs/examples/1.1.x/server-kotlin/java/functions/get.md index 32aea80181..8e1cd5ef29 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/get.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.get( + functionId = "[FUNCTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.get( - "[FUNCTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list-deployments.md b/docs/examples/1.1.x/server-kotlin/java/functions/list-deployments.md index 60bfd902ef..920684554c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list-deployments.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list-deployments.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.listDeployments( + functionId = "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.listDeployments( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list-executions.md b/docs/examples/1.1.x/server-kotlin/java/functions/list-executions.md index 2c11cee217..915bf64d4b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list-executions.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list-executions.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.listExecutions( + functionId = "[FUNCTION_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.listExecutions( - "[FUNCTION_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list-runtimes.md b/docs/examples/1.1.x/server-kotlin/java/functions/list-runtimes.md index 91739e55f5..e70bd27f76 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list-runtimes.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list-runtimes.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.listRuntimes(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.listRuntimes(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list-variables.md b/docs/examples/1.1.x/server-kotlin/java/functions/list-variables.md index e053e72cdf..abe6f93e3c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list-variables.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list-variables.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.listVariables( + functionId = "[FUNCTION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.listVariables( - "[FUNCTION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/list.md b/docs/examples/1.1.x/server-kotlin/java/functions/list.md index 1dff9a9804..e365f30f1f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/list.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/list.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/update-deployment.md b/docs/examples/1.1.x/server-kotlin/java/functions/update-deployment.md index ca66695d89..e13f2e2471 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/update-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/update-deployment.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.updateDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.updateDeployment( - "[FUNCTION_ID]", - "[DEPLOYMENT_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/update-variable.md b/docs/examples/1.1.x/server-kotlin/java/functions/update-variable.md index de96ea2bc9..adede4786f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/update-variable.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/update-variable.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.updateVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]", + key = "[KEY]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.updateVariable( - "[FUNCTION_ID]", - "[VARIABLE_ID]", - "[KEY]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/functions/update.md b/docs/examples/1.1.x/server-kotlin/java/functions/update.md index 8157cbb5f9..a9b1f9f787 100644 --- a/docs/examples/1.1.x/server-kotlin/java/functions/update.md +++ b/docs/examples/1.1.x/server-kotlin/java/functions/update.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Functions; +import io.appwrite.Client +import io.appwrite.services.Functions -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Functions functions = new Functions(client); + Functions functions = new Functions(client); + functions.update( + functionId = "[FUNCTION_ID]", + name = "[NAME]", + execute = listOf("any"), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -functions.update( - "[FUNCTION_ID]", - "[NAME]", - listOf("any"), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-antivirus.md b/docs/examples/1.1.x/server-kotlin/java/health/get-antivirus.md index ddabb1910b..3a40f730a2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-antivirus.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-antivirus.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getAntivirus(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getAntivirus(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-cache.md b/docs/examples/1.1.x/server-kotlin/java/health/get-cache.md index d80ed9dcdc..e7300a34f4 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-cache.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-cache.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getCache(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getCache(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-d-b.md b/docs/examples/1.1.x/server-kotlin/java/health/get-d-b.md index f4a262bda4..9644806bd2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-d-b.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-d-b.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getDB(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getDB(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-certificates.md b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-certificates.md index ac3ed093d4..084576b65a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-certificates.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-certificates.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getQueueCertificates(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getQueueCertificates(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-functions.md b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-functions.md index f80c151318..9809a03d2f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-functions.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-functions.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getQueueFunctions(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getQueueFunctions(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-logs.md b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-logs.md index e639e43505..4a08fa9321 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-logs.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-logs.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getQueueLogs(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getQueueLogs(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-webhooks.md b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-webhooks.md index 120cb1c4c9..d8bc27a2bf 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-queue-webhooks.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-queue-webhooks.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getQueueWebhooks(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getQueueWebhooks(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-storage-local.md b/docs/examples/1.1.x/server-kotlin/java/health/get-storage-local.md index 9ecaf9a739..079eca49e1 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-storage-local.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-storage-local.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getStorageLocal(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getStorageLocal(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get-time.md b/docs/examples/1.1.x/server-kotlin/java/health/get-time.md index d28bcac0f5..a8ca3b91de 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get-time.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get-time.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.getTime(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.getTime(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/health/get.md b/docs/examples/1.1.x/server-kotlin/java/health/get.md index da31c13879..30adbbbf60 100644 --- a/docs/examples/1.1.x/server-kotlin/java/health/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/health/get.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.Client +import io.appwrite.services.Health -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Health health = new Health(client); + Health health = new Health(client); + health.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -health.get(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/get.md b/docs/examples/1.1.x/server-kotlin/java/locale/get.md index ea30543905..bf2f34fb02 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/get.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.get(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.get(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-continents.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-continents.md index 888d85c597..479d82fc5c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-continents.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-continents.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listContinents(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listContinents(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-e-u.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-e-u.md index 5bf264a5f4..ac702cda1f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-e-u.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listCountriesEU(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-phones.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-phones.md index f872d4280c..a16ca213c7 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries-phones.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listCountriesPhones(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries.md index 6be2b8eeaf..85271a7a92 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-countries.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-countries.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listCountries(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listCountries(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-currencies.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-currencies.md index f954b8118b..9afff9416a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-currencies.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-currencies.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listCurrencies(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listCurrencies(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/locale/list-languages.md b/docs/examples/1.1.x/server-kotlin/java/locale/list-languages.md index a5fc966d51..71457d837a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/locale/list-languages.md +++ b/docs/examples/1.1.x/server-kotlin/java/locale/list-languages.md @@ -1,19 +1,33 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Locale; +import io.appwrite.Client +import io.appwrite.services.Locale -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Locale locale = new Locale(client); + Locale locale = new Locale(client); + locale.listLanguages(new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -locale.listLanguages(new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); -})); + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } + }); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/create-bucket.md b/docs/examples/1.1.x/server-kotlin/java/storage/create-bucket.md index 159d5c25fa..6d792e5f5b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/create-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/create-bucket.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.createBucket( + bucketId = "[BUCKET_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.createBucket( - "[BUCKET_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/create-file.md b/docs/examples/1.1.x/server-kotlin/java/storage/create-file.md index 35e4573496..7924fb255f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/create-file.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/create-file.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.models.InputFile; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.models.InputFile +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.createFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + file = InputFile.fromPath("file.png"), + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.createFile( - "[BUCKET_ID]", - "[FILE_ID]", - InputFile.fromPath("file.png"), - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/delete-bucket.md b/docs/examples/1.1.x/server-kotlin/java/storage/delete-bucket.md index e8cb06f141..5d00b7bc6d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/delete-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/delete-bucket.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.deleteBucket( + bucketId = "[BUCKET_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.deleteBucket( - "[BUCKET_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/delete-file.md b/docs/examples/1.1.x/server-kotlin/java/storage/delete-file.md index 6f6c29a651..3d41866c53 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/delete-file.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/delete-file.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.deleteFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.deleteFile( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-bucket.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-bucket.md index da54b6fb8d..c8b92bda98 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-bucket.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getBucket( + bucketId = "[BUCKET_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getBucket( - "[BUCKET_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-download.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-download.md index 856818ea08..b116d5bb7b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-download.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-download.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getFileDownload( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getFileDownload( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-preview.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-preview.md index fe31fd8b73..32284dc7e3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-preview.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-preview.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getFilePreview( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getFilePreview( - "[BUCKET_ID]", - "[FILE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-view.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-view.md index d7b52635ac..0332da5e89 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-file-view.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-file-view.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getFileView( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getFileView( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/get-file.md b/docs/examples/1.1.x/server-kotlin/java/storage/get-file.md index 2019cea62e..61e3d6c20c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/get-file.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/get-file.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.getFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.getFile( - "[BUCKET_ID]", - "[FILE_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/list-buckets.md b/docs/examples/1.1.x/server-kotlin/java/storage/list-buckets.md index 30e689a8f0..ffce5eb986 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/list-buckets.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/list-buckets.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.listBuckets( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.listBuckets( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/list-files.md b/docs/examples/1.1.x/server-kotlin/java/storage/list-files.md index 3fde8592f2..de33a00b46 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/list-files.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/list-files.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.listFiles( + bucketId = "[BUCKET_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.listFiles( - "[BUCKET_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/update-bucket.md b/docs/examples/1.1.x/server-kotlin/java/storage/update-bucket.md index e722847f95..d2c6991287 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/update-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/update-bucket.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.updateBucket( + bucketId = "[BUCKET_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.updateBucket( - "[BUCKET_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/storage/update-file.md b/docs/examples/1.1.x/server-kotlin/java/storage/update-file.md index 785bc56093..e1c2ed440c 100644 --- a/docs/examples/1.1.x/server-kotlin/java/storage/update-file.md +++ b/docs/examples/1.1.x/server-kotlin/java/storage/update-file.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Storage; +import io.appwrite.Client +import io.appwrite.services.Storage -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Storage storage = new Storage(client); + Storage storage = new Storage(client); + storage.updateFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -storage.updateFile( - "[BUCKET_ID]", - "[FILE_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/create-membership.md b/docs/examples/1.1.x/server-kotlin/java/teams/create-membership.md index f4afed4c42..077ce3f058 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/create-membership.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/create-membership.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.createMembership( + teamId = "[TEAM_ID]", + email = "email@example.com", + roles = listOf(), + url = "https://example.com", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.createMembership( - "[TEAM_ID]", - "email@example.com", - listOf(), - "https://example.com", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/create.md b/docs/examples/1.1.x/server-kotlin/java/teams/create.md index 48ec37dfd4..3cc1f9d19d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/create.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/create.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.create( + teamId = "[TEAM_ID]", + name = "[NAME]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.create( - "[TEAM_ID]", - "[NAME]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/delete-membership.md b/docs/examples/1.1.x/server-kotlin/java/teams/delete-membership.md index 5039300b4f..7a57a32d9a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/delete-membership.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/delete-membership.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.deleteMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.deleteMembership( - "[TEAM_ID]", - "[MEMBERSHIP_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/delete.md b/docs/examples/1.1.x/server-kotlin/java/teams/delete.md index 012dde8be2..7ace480161 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/delete.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/delete.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.delete( + teamId = "[TEAM_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.delete( - "[TEAM_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/get-membership.md b/docs/examples/1.1.x/server-kotlin/java/teams/get-membership.md index dbf871179f..5d4890693d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/get-membership.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/get-membership.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.getMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.getMembership( - "[TEAM_ID]", - "[MEMBERSHIP_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/get.md b/docs/examples/1.1.x/server-kotlin/java/teams/get.md index b997f2506a..23f52dc5c5 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/get.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.get( + teamId = "[TEAM_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.get( - "[TEAM_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/list-memberships.md b/docs/examples/1.1.x/server-kotlin/java/teams/list-memberships.md index 29fd16ec7a..881b325d99 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/list-memberships.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/list-memberships.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.listMemberships( + teamId = "[TEAM_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.listMemberships( - "[TEAM_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/list.md b/docs/examples/1.1.x/server-kotlin/java/teams/list.md index 29e2dd594f..2a7bf89f6e 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/list.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/list.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-roles.md b/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-roles.md index 79615e199e..7e8d68283d 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-roles.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.updateMembershipRoles( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + roles = listOf() + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.updateMembershipRoles( - "[TEAM_ID]", - "[MEMBERSHIP_ID]", - listOf() - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-status.md b/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-status.md index 6fbb53c5d6..0a528d4d81 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-status.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/update-membership-status.md @@ -1,25 +1,39 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.updateMembershipStatus( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + userId = "[USER_ID]", + secret = "[SECRET]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.updateMembershipStatus( - "[TEAM_ID]", - "[MEMBERSHIP_ID]", - "[USER_ID]", - "[SECRET]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/teams/update.md b/docs/examples/1.1.x/server-kotlin/java/teams/update.md index b8ca109237..5c05d6a65f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/teams/update.md +++ b/docs/examples/1.1.x/server-kotlin/java/teams/update.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Teams; +import io.appwrite.Client +import io.appwrite.services.Teams -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Teams teams = new Teams(client); + Teams teams = new Teams(client); + teams.update( + teamId = "[TEAM_ID]", + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -teams.update( - "[TEAM_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-argon2user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-argon2user.md index 6b55edf749..04a93bb94b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-argon2user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-argon2user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createArgon2User( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createArgon2User( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-bcrypt-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-bcrypt-user.md index bfecdbd354..026b4593a2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-bcrypt-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-bcrypt-user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createBcryptUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createBcryptUser( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-m-d5user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-m-d5user.md index 993390dd07..06b0ee0a38 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-m-d5user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-m-d5user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createMD5User( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createMD5User( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-p-h-pass-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-p-h-pass-user.md index d6a3982d58..5dcc377297 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-p-h-pass-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-p-h-pass-user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createPHPassUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createPHPassUser( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-s-h-a-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-s-h-a-user.md index bcc79e5546..2bb0c18c31 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-s-h-a-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-s-h-a-user.md @@ -1,24 +1,38 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createSHAUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createSHAUser( - "[USER_ID]", - "email@example.com", - "password", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-modified-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-modified-user.md index dfd588f23e..2c0c73f72f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-modified-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-modified-user.md @@ -1,27 +1,41 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createScryptModifiedUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + passwordSalt = "[PASSWORD_SALT]", + passwordSaltSeparator = "[PASSWORD_SALT_SEPARATOR]", + passwordSignerKey = "[PASSWORD_SIGNER_KEY]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createScryptModifiedUser( - "[USER_ID]", - "email@example.com", - "password", - "[PASSWORD_SALT]", - "[PASSWORD_SALT_SEPARATOR]", - "[PASSWORD_SIGNER_KEY]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-user.md b/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-user.md index 3b37033525..74143e9523 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-user.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create-scrypt-user.md @@ -1,29 +1,43 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.createScryptUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + passwordSalt = "[PASSWORD_SALT]", + passwordCpu = 0, + passwordMemory = 0, + passwordParallel = 0, + passwordLength = 0, + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.createScryptUser( - "[USER_ID]", - "email@example.com", - "password", - "[PASSWORD_SALT]", - 0, - 0, - 0, - 0, - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/create.md b/docs/examples/1.1.x/server-kotlin/java/users/create.md index 6ceaaf11d2..e52912555b 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/create.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/create.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.create( + userId = "[USER_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.create( - "[USER_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/delete-session.md b/docs/examples/1.1.x/server-kotlin/java/users/delete-session.md index 8f10fce2bb..7295506bc2 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/delete-session.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/delete-session.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.deleteSession( + userId = "[USER_ID]", + sessionId = "[SESSION_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.deleteSession( - "[USER_ID]", - "[SESSION_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/delete-sessions.md b/docs/examples/1.1.x/server-kotlin/java/users/delete-sessions.md index 2f409ae3c6..6fb4028c37 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/delete-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/delete-sessions.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.deleteSessions( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.deleteSessions( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/delete.md b/docs/examples/1.1.x/server-kotlin/java/users/delete.md index db85c034e1..f004170a1e 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/delete.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/delete.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.delete( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.delete( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/get-prefs.md b/docs/examples/1.1.x/server-kotlin/java/users/get-prefs.md index 376aed1ec8..d45fbf4682 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/get-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/get-prefs.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.getPrefs( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.getPrefs( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/get.md b/docs/examples/1.1.x/server-kotlin/java/users/get.md index 55b834335f..98b3df0680 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/get.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/get.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.get( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.get( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/list-logs.md b/docs/examples/1.1.x/server-kotlin/java/users/list-logs.md index ac58021b3e..38051cbacd 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/list-logs.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/list-logs.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.listLogs( + userId = "[USER_ID]", + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.listLogs( - "[USER_ID]", - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/list-memberships.md b/docs/examples/1.1.x/server-kotlin/java/users/list-memberships.md index 1987671a36..d2f21bc0bd 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/list-memberships.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/list-memberships.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.listMemberships( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.listMemberships( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/list-sessions.md b/docs/examples/1.1.x/server-kotlin/java/users/list-sessions.md index 9c756927fd..9adadf686f 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/list-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/list-sessions.md @@ -1,22 +1,36 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.listSessions( + userId = "[USER_ID]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.listSessions( - "[USER_ID]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/list.md b/docs/examples/1.1.x/server-kotlin/java/users/list.md index 469a47f9a9..f0c4710b65 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/list.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/list.md @@ -1,21 +1,35 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.list( + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.list( - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-email-verification.md b/docs/examples/1.1.x/server-kotlin/java/users/update-email-verification.md index 02df31045a..b7278cad38 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-email-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-email-verification.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updateEmailVerification( + userId = "[USER_ID]", + emailVerification = false + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updateEmailVerification( - "[USER_ID]", - false - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-email.md b/docs/examples/1.1.x/server-kotlin/java/users/update-email.md index 0003961b85..c023caa014 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-email.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-email.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updateEmail( + userId = "[USER_ID]", + email = "email@example.com" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updateEmail( - "[USER_ID]", - "email@example.com" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-name.md b/docs/examples/1.1.x/server-kotlin/java/users/update-name.md index 51a3004c2c..cf760ae78a 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-name.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-name.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updateName( + userId = "[USER_ID]", + name = "[NAME]" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updateName( - "[USER_ID]", - "[NAME]" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-password.md b/docs/examples/1.1.x/server-kotlin/java/users/update-password.md index 6d6a9d38e0..a8fc3f3c50 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-password.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-password.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updatePassword( + userId = "[USER_ID]", + password = "password" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updatePassword( - "[USER_ID]", - "password" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-phone-verification.md b/docs/examples/1.1.x/server-kotlin/java/users/update-phone-verification.md index 8c93bf9cac..65b6341f1e 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-phone-verification.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updatePhoneVerification( + userId = "[USER_ID]", + phoneVerification = false + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updatePhoneVerification( - "[USER_ID]", - false - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-phone.md b/docs/examples/1.1.x/server-kotlin/java/users/update-phone.md index af12493e87..1ccbd0cbe6 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-phone.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-phone.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updatePhone( + userId = "[USER_ID]", + number = "+12065550100" + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updatePhone( - "[USER_ID]", - "+12065550100" - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-prefs.md b/docs/examples/1.1.x/server-kotlin/java/users/update-prefs.md index 5ee41f3076..393366cf10 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-prefs.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updatePrefs( + userId = "[USER_ID]", + prefs = mapOf( "a" to "b" ) + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updatePrefs( - "[USER_ID]", - mapOf( "a" to "b" ) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/java/users/update-status.md b/docs/examples/1.1.x/server-kotlin/java/users/update-status.md index 21b4382dab..e847dcedc3 100644 --- a/docs/examples/1.1.x/server-kotlin/java/users/update-status.md +++ b/docs/examples/1.1.x/server-kotlin/java/users/update-status.md @@ -1,23 +1,37 @@ -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Users; +import io.appwrite.Client +import io.appwrite.services.Users -Client client = new Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +public void main() { + Client client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Users users = new Users(client); + Users users = new Users(client); + users.updateStatus( + userId = "[USER_ID]", + status = false + new Continuation() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } -users.updateStatus( - "[USER_ID]", - false - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; + @Override + public void resumeWith(@NotNull Object o) { + String json = ""; + try { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + throw failure.exception; + } else { + Response response = (Response) o; + } + } catch (Throwable th) { + Log.e("ERROR", th.toString()); + } + } } - - System.out.println(result); - }) -); + ); +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-phone-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-phone-verification.md index 888a22db58..c097b00f88 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-phone-verification.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.createPhoneVerification() + val account = Account(client) + val response = account.createPhoneVerification() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-recovery.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-recovery.md index 200c116210..e43eaf8698 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-recovery.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-recovery.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.createRecovery( - email = "email@example.com", - url = "https://example.com" -) + val account = Account(client) + val response = account.createRecovery( + email = "email@example.com", + url = "https://example.com" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-verification.md index 5ee92f6e5c..41f34631b6 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/create-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/create-verification.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.createVerification( - url = "https://example.com" -) + val account = Account(client) + val response = account.createVerification( + url = "https://example.com" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-session.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-session.md index adfae4336f..11b91b05eb 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-session.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-session.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.deleteSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + val response = account.deleteSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-sessions.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-sessions.md index ca281570e0..5ff7c5ce75 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/delete-sessions.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.deleteSessions() + val account = Account(client) + val response = account.deleteSessions() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/get-prefs.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/get-prefs.md index cf13c75d22..8d836f1a83 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/get-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/get-prefs.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.getPrefs() + val account = Account(client) + val response = account.getPrefs() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/get-session.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/get-session.md index f42507b8f5..3a3ae1fbb3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/get-session.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/get-session.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.getSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + val response = account.getSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/get.md index dcaf9e93de..4195939136 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/get.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.get() + val account = Account(client) + val response = account.get() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/list-logs.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/list-logs.md index 415810b7d6..4fa66a9b72 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/list-logs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/list-logs.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.listLogs( -) + val account = Account(client) + val response = account.listLogs( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/list-sessions.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/list-sessions.md index b9bf3fe7a9..ca8f4f67d4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/list-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/list-sessions.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.listSessions() + val account = Account(client) + val response = account.listSessions() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-email.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-email.md index ae67e105c2..b58849393d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-email.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-email.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateEmail( - email = "email@example.com", - password = "password" -) + val account = Account(client) + val response = account.updateEmail( + email = "email@example.com", + password = "password" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-name.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-name.md index fabf584bfd..c54140f26d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-name.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-name.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateName( - name = "[NAME]" -) + val account = Account(client) + val response = account.updateName( + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-password.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-password.md index 0b22998649..3953718593 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-password.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-password.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updatePassword( - password = "password", -) + val account = Account(client) + val response = account.updatePassword( + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone-verification.md index f5a5faf730..1d601ce54b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone-verification.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updatePhoneVerification( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + val response = account.updatePhoneVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone.md index 8de0b542f5..01bb2b8d43 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-phone.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updatePhone( - phone = "+12065550100", - password = "password" -) + val account = Account(client) + val response = account.updatePhone( + phone = "+12065550100", + password = "password" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-prefs.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-prefs.md index 6c569affda..39696911d8 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-prefs.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updatePrefs( - prefs = mapOf( "a" to "b" ) -) + val account = Account(client) + val response = account.updatePrefs( + prefs = mapOf( "a" to "b" ) + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-recovery.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-recovery.md index f6c5d75d4e..8d2253a5fb 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-recovery.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-recovery.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateRecovery( - userId = "[USER_ID]", - secret = "[SECRET]", - password = "password", - passwordAgain = "password" -) + val account = Account(client) + val response = account.updateRecovery( + userId = "[USER_ID]", + secret = "[SECRET]", + password = "password", + passwordAgain = "password" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-session.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-session.md index 5b8ee817b0..003d80e688 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-session.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-session.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateSession( - sessionId = "[SESSION_ID]" -) + val account = Account(client) + val response = account.updateSession( + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-status.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-status.md index 99996a3970..c64ce0c26f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-status.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-status.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateStatus() + val account = Account(client) + val response = account.updateStatus() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-verification.md index ba86276f22..f904f6d2ce 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/account/update-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/account/update-verification.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Account -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val account = Account(client) - -val response = account.updateVerification( - userId = "[USER_ID]", - secret = "[SECRET]" -) + val account = Account(client) + val response = account.updateVerification( + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-browser.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-browser.md index 9fe8b3e76f..d021a952e4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-browser.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-browser.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getBrowser( - code = "aa", -) + val avatars = Avatars(client) + val result = avatars.getBrowser( + code = "aa", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-credit-card.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-credit-card.md index cdf31a270e..61592bc3d9 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-credit-card.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getCreditCard( - code = "amex", -) + val avatars = Avatars(client) + val result = avatars.getCreditCard( + code = "amex", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-favicon.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-favicon.md index 888ba71fa1..3714ac210a 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-favicon.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-favicon.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getFavicon( - url = "https://example.com" -) + val avatars = Avatars(client) + val result = avatars.getFavicon( + url = "https://example.com" + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-flag.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-flag.md index cf3ef4cc38..0efd3c9974 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-flag.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-flag.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getFlag( - code = "af", -) + val avatars = Avatars(client) + val result = avatars.getFlag( + code = "af", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-image.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-image.md index 2de2d65630..0d3f855617 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-image.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-image.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getImage( - url = "https://example.com", -) + val avatars = Avatars(client) + val result = avatars.getImage( + url = "https://example.com", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-initials.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-initials.md index efbd55d31f..de5a30c5c1 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-initials.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-initials.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getInitials( -) + val avatars = Avatars(client) + val result = avatars.getInitials( + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-q-r.md b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-q-r.md index ab4b35ee78..008922575d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-q-r.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/avatars/get-q-r.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Avatars -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val avatars = Avatars(client) - -val result = avatars.getQR( - text = "[TEXT]", -) + val avatars = Avatars(client) + val result = avatars.getQR( + text = "[TEXT]", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-boolean-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-boolean-attribute.md index 47f5913811..bfcd659979 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-boolean-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-boolean-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createBooleanAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createBooleanAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-collection.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-collection.md index c7ba19fcd7..1e31833d1e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-collection.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-collection.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createCollection( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - name = "[NAME]", -) + val databases = Databases(client) + val response = databases.createCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-datetime-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-datetime-attribute.md index a76f930ee2..c9d45b461d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-datetime-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-datetime-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createDatetimeAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createDatetimeAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-document.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-document.md index ea61d6de17..91519fd570 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-document.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-document.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", - data = mapOf( "a" to "b" ), -) + val databases = Databases(client) + val response = databases.createDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + data = mapOf( "a" to "b" ), + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-email-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-email-attribute.md index 52a2f3f57f..5dbdd1c769 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-email-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-email-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createEmailAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createEmailAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-enum-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-enum-attribute.md index c8d2304c4b..afb91ed73c 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-enum-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-enum-attribute.md @@ -1,17 +1,19 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createEnumAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - elements = listOf(), - required = false, -) + val databases = Databases(client) + val response = databases.createEnumAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + elements = listOf(), + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-float-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-float-attribute.md index 52caba7a55..e80aa4289a 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-float-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-float-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createFloatAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createFloatAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-index.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-index.md index 01aa222ac4..d3e99bfdcc 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-index.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-index.md @@ -1,17 +1,19 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createIndex( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - type = "key", - attributes = listOf(), -) + val databases = Databases(client) + val response = databases.createIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + type = "key", + attributes = listOf(), + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-integer-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-integer-attribute.md index ddf85f6b3b..81d6d108bf 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-integer-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-integer-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createIntegerAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createIntegerAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-ip-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-ip-attribute.md index 77e6f37ffb..fa5a3c5eaa 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-ip-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-ip-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createIpAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createIpAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-string-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-string-attribute.md index 0cb036e4de..285afc1b31 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-string-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-string-attribute.md @@ -1,17 +1,19 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createStringAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - size = 1, - required = false, -) + val databases = Databases(client) + val response = databases.createStringAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + size = 1, + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-url-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-url-attribute.md index 403e93e2a7..182f63d6ff 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-url-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create-url-attribute.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.createUrlAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "", - required = false, -) + val databases = Databases(client) + val response = databases.createUrlAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "", + required = false, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create.md index 3a37ddc43c..7a93045eb6 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/create.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/create.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.create( - databaseId = "[DATABASE_ID]", - name = "[NAME]" -) + val databases = Databases(client) + val response = databases.create( + databaseId = "[DATABASE_ID]", + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-attribute.md index 6fad48dd77..e83088bdef 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-attribute.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.deleteAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "" -) + val databases = Databases(client) + val response = databases.deleteAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-collection.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-collection.md index a03b75c7eb..95e31e3256 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-collection.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-collection.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.deleteCollection( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]" -) + val databases = Databases(client) + val response = databases.deleteCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-document.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-document.md index 93334b3b34..d085c38dfc 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-document.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-document.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.deleteDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" -) + val databases = Databases(client) + val response = databases.deleteDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-index.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-index.md index 9e68f8b5e2..ccb718146f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-index.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete-index.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.deleteIndex( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "" -) + val databases = Databases(client) + val response = databases.deleteIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete.md index f7aae2e655..96bb1acf68 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/delete.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.delete( - databaseId = "[DATABASE_ID]" -) + val databases = Databases(client) + val response = databases.delete( + databaseId = "[DATABASE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-attribute.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-attribute.md index 59f3890e53..acedd9ef9a 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-attribute.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-attribute.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.getAttribute( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "" -) + val databases = Databases(client) + val response = databases.getAttribute( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-collection.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-collection.md index 6086698a82..8165a3ae97 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-collection.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-collection.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.getCollection( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]" -) + val databases = Databases(client) + val response = databases.getCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-document.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-document.md index 8c3ce7cb81..671d7302cb 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-document.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-document.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.getDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]" -) + val databases = Databases(client) + val response = databases.getDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-index.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-index.md index 3e7315b3b8..1f5079c800 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-index.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get-index.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.getIndex( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - key = "" -) + val databases = Databases(client) + val response = databases.getIndex( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + key = "" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get.md index 0bd67f6fb8..f8ad2647ed 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/get.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.get( - databaseId = "[DATABASE_ID]" -) + val databases = Databases(client) + val response = databases.get( + databaseId = "[DATABASE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-attributes.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-attributes.md index 5652bcb442..65e43d8b76 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-attributes.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-attributes.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.listAttributes( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]" -) + val databases = Databases(client) + val response = databases.listAttributes( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-collections.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-collections.md index 7b37719e6a..c72512f97b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-collections.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-collections.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.listCollections( - databaseId = "[DATABASE_ID]", -) + val databases = Databases(client) + val response = databases.listCollections( + databaseId = "[DATABASE_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-documents.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-documents.md index be97089801..d28ee1bb0f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-documents.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-documents.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.listDocuments( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", -) + val databases = Databases(client) + val response = databases.listDocuments( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-indexes.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-indexes.md index 0b3459544c..0cd2fc8617 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-indexes.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list-indexes.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.listIndexes( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]" -) + val databases = Databases(client) + val response = databases.listIndexes( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list.md index 9997b5b5fa..b4ece0a1a3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/list.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/list.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.list( -) + val databases = Databases(client) + val response = databases.list( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-collection.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-collection.md index dc15ceadc4..a28d88634b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-collection.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-collection.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.updateCollection( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - name = "[NAME]", -) + val databases = Databases(client) + val response = databases.updateCollection( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-document.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-document.md index 9337f56657..8121fdd07c 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-document.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update-document.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.updateDocument( - databaseId = "[DATABASE_ID]", - collectionId = "[COLLECTION_ID]", - documentId = "[DOCUMENT_ID]", -) + val databases = Databases(client) + val response = databases.updateDocument( + databaseId = "[DATABASE_ID]", + collectionId = "[COLLECTION_ID]", + documentId = "[DOCUMENT_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update.md b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update.md index 995d681ae9..0e0adee643 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/databases/update.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/databases/update.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Databases -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val databases = Databases(client) - -val response = databases.update( - databaseId = "[DATABASE_ID]", - name = "[NAME]" -) + val databases = Databases(client) + val response = databases.update( + databaseId = "[DATABASE_ID]", + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-build.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-build.md index 4cb3323796..b19c04528b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-build.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-build.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.createBuild( - functionId = "[FUNCTION_ID]", - deploymentId = "[DEPLOYMENT_ID]", - buildId = "[BUILD_ID]" -) + val functions = Functions(client) + val response = functions.createBuild( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]", + buildId = "[BUILD_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-deployment.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-deployment.md index d63625c89e..9a2dc43359 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-deployment.md @@ -2,16 +2,18 @@ import io.appwrite.Client import io.appwrite.models.InputFile import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.createDeployment( - functionId = "[FUNCTION_ID]", - entrypoint = "[ENTRYPOINT]", - code = InputFile.fromPath("file.png"), - activate = false -) + val functions = Functions(client) + val response = functions.createDeployment( + functionId = "[FUNCTION_ID]", + entrypoint = "[ENTRYPOINT]", + code = InputFile.fromPath("file.png"), + activate = false + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-execution.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-execution.md index 086983e620..eeda8daf3e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-execution.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-execution.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.createExecution( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + val response = functions.createExecution( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-variable.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-variable.md index a059845fd4..416e1d09b7 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-variable.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create-variable.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.createVariable( - functionId = "[FUNCTION_ID]", - key = "[KEY]", - value = "[VALUE]" -) + val functions = Functions(client) + val response = functions.createVariable( + functionId = "[FUNCTION_ID]", + key = "[KEY]", + value = "[VALUE]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create.md index 9456721680..280b3ec132 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/create.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/create.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.create( - functionId = "[FUNCTION_ID]", - name = "[NAME]", - execute = listOf("any"), - runtime = "node-14.5", -) + val functions = Functions(client) + val response = functions.create( + functionId = "[FUNCTION_ID]", + name = "[NAME]", + execute = listOf("any"), + runtime = "node-14.5", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-deployment.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-deployment.md index 334ad44d37..cc90059f85 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-deployment.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.deleteDeployment( - functionId = "[FUNCTION_ID]", - deploymentId = "[DEPLOYMENT_ID]" -) + val functions = Functions(client) + val response = functions.deleteDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-variable.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-variable.md index f823e06231..8ca7af63e5 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-variable.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete-variable.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.deleteVariable( - functionId = "[FUNCTION_ID]", - variableId = "[VARIABLE_ID]" -) + val functions = Functions(client) + val response = functions.deleteVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete.md index 56ce7c0744..40a7e9682f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/delete.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.delete( - functionId = "[FUNCTION_ID]" -) + val functions = Functions(client) + val response = functions.delete( + functionId = "[FUNCTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-deployment.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-deployment.md index 9f0d5a7b4e..fa6175271e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-deployment.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.getDeployment( - functionId = "[FUNCTION_ID]", - deploymentId = "[DEPLOYMENT_ID]" -) + val functions = Functions(client) + val response = functions.getDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-execution.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-execution.md index 3905ef28a1..d23e20766e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-execution.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-execution.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.getExecution( - functionId = "[FUNCTION_ID]", - executionId = "[EXECUTION_ID]" -) + val functions = Functions(client) + val response = functions.getExecution( + functionId = "[FUNCTION_ID]", + executionId = "[EXECUTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-variable.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-variable.md index 4b5844ec1c..d277bbb735 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-variable.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get-variable.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.getVariable( - functionId = "[FUNCTION_ID]", - variableId = "[VARIABLE_ID]" -) + val functions = Functions(client) + val response = functions.getVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get.md index 6ccb9c0774..76a45b6b26 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/get.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.get( - functionId = "[FUNCTION_ID]" -) + val functions = Functions(client) + val response = functions.get( + functionId = "[FUNCTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-deployments.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-deployments.md index 349f43eb78..be30acacef 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-deployments.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-deployments.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.listDeployments( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + val response = functions.listDeployments( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-executions.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-executions.md index 2374601d8f..2427a97644 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-executions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-executions.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.listExecutions( - functionId = "[FUNCTION_ID]", -) + val functions = Functions(client) + val response = functions.listExecutions( + functionId = "[FUNCTION_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-runtimes.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-runtimes.md index ee853d30fa..7236d74475 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-runtimes.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-runtimes.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.listRuntimes() + val functions = Functions(client) + val response = functions.listRuntimes() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-variables.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-variables.md index 1d75a7cf29..a6adc00c6d 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-variables.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list-variables.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.listVariables( - functionId = "[FUNCTION_ID]" -) + val functions = Functions(client) + val response = functions.listVariables( + functionId = "[FUNCTION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list.md index abe4b24902..1fb1f54a3c 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/list.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/list.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.list( -) + val functions = Functions(client) + val response = functions.list( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-deployment.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-deployment.md index ec6eeb2e68..fd7a40b2ec 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-deployment.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-deployment.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.updateDeployment( - functionId = "[FUNCTION_ID]", - deploymentId = "[DEPLOYMENT_ID]" -) + val functions = Functions(client) + val response = functions.updateDeployment( + functionId = "[FUNCTION_ID]", + deploymentId = "[DEPLOYMENT_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-variable.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-variable.md index cca000d758..1cc5563c87 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-variable.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update-variable.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.updateVariable( - functionId = "[FUNCTION_ID]", - variableId = "[VARIABLE_ID]", - key = "[KEY]", -) + val functions = Functions(client) + val response = functions.updateVariable( + functionId = "[FUNCTION_ID]", + variableId = "[VARIABLE_ID]", + key = "[KEY]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update.md b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update.md index ace7b68354..ae5bee1236 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/functions/update.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/functions/update.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Functions -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val functions = Functions(client) - -val response = functions.update( - functionId = "[FUNCTION_ID]", - name = "[NAME]", - execute = listOf("any"), -) + val functions = Functions(client) + val response = functions.update( + functionId = "[FUNCTION_ID]", + name = "[NAME]", + execute = listOf("any"), + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-antivirus.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-antivirus.md index 7818055e7d..fe64ba8ee1 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-antivirus.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-antivirus.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getAntivirus() + val health = Health(client) + val response = health.getAntivirus() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-cache.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-cache.md index 6bda0bfb3e..91dda5e06e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-cache.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-cache.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getCache() + val health = Health(client) + val response = health.getCache() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-d-b.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-d-b.md index 49a983e234..0a15ff78b4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-d-b.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-d-b.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getDB() + val health = Health(client) + val response = health.getDB() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-certificates.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-certificates.md index 12923e30ac..4e51cc625e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-certificates.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-certificates.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getQueueCertificates() + val health = Health(client) + val response = health.getQueueCertificates() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-functions.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-functions.md index 2b0d47a52a..2f49b8f013 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-functions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-functions.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getQueueFunctions() + val health = Health(client) + val response = health.getQueueFunctions() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-logs.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-logs.md index b7a50dd549..0a15075dd7 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-logs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-logs.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getQueueLogs() + val health = Health(client) + val response = health.getQueueLogs() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-webhooks.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-webhooks.md index 64df02ede7..368a4d3cc6 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-webhooks.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-queue-webhooks.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getQueueWebhooks() + val health = Health(client) + val response = health.getQueueWebhooks() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-storage-local.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-storage-local.md index d016deb24b..809c4a92b9 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-storage-local.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-storage-local.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getStorageLocal() + val health = Health(client) + val response = health.getStorageLocal() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-time.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-time.md index c040287f01..9e2b5a9f89 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get-time.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get-time.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.getTime() + val health = Health(client) + val response = health.getTime() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/health/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/health/get.md index 0692d55206..5904493e30 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/health/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/health/get.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Health -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val health = Health(client) - -val response = health.get() + val health = Health(client) + val response = health.get() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/get.md index e6f78f5f10..d630031194 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/get.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.get() + val locale = Locale(client) + val response = locale.get() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-continents.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-continents.md index 6e533d3dc2..d3f748b1d5 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-continents.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-continents.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listContinents() + val locale = Locale(client) + val response = locale.listContinents() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-e-u.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-e-u.md index 4002981f36..37b19bd551 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-e-u.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listCountriesEU() + val locale = Locale(client) + val response = locale.listCountriesEU() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-phones.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-phones.md index 9002118d19..a001f2a9b3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries-phones.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listCountriesPhones() + val locale = Locale(client) + val response = locale.listCountriesPhones() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries.md index ccb09e51b7..54efc257ab 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-countries.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listCountries() + val locale = Locale(client) + val response = locale.listCountries() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-currencies.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-currencies.md index 677090a327..0875fa8449 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-currencies.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-currencies.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listCurrencies() + val locale = Locale(client) + val response = locale.listCurrencies() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-languages.md b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-languages.md index 8b363f12ea..a873770896 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-languages.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/locale/list-languages.md @@ -1,11 +1,13 @@ import io.appwrite.Client import io.appwrite.services.Locale -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val locale = Locale(client) - -val response = locale.listLanguages() + val locale = Locale(client) + val response = locale.listLanguages() + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-bucket.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-bucket.md index 18a9ae00a7..9082399007 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-bucket.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.createBucket( - bucketId = "[BUCKET_ID]", - name = "[NAME]", -) + val storage = Storage(client) + val response = storage.createBucket( + bucketId = "[BUCKET_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-file.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-file.md index 9376d6c9b4..65046d0cc1 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-file.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/create-file.md @@ -2,15 +2,17 @@ import io.appwrite.Client import io.appwrite.models.InputFile import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.createFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", - file = InputFile.fromPath("file.png"), -) + val storage = Storage(client) + val response = storage.createFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + file = InputFile.fromPath("file.png"), + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-bucket.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-bucket.md index d99a0ee67d..0700ffdb30 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-bucket.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.deleteBucket( - bucketId = "[BUCKET_ID]" -) + val storage = Storage(client) + val response = storage.deleteBucket( + bucketId = "[BUCKET_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-file.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-file.md index 6e98d37705..2749cc2135 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-file.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/delete-file.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.deleteFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + val response = storage.deleteFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-bucket.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-bucket.md index 855daced37..6e421e94af 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-bucket.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.getBucket( - bucketId = "[BUCKET_ID]" -) + val storage = Storage(client) + val response = storage.getBucket( + bucketId = "[BUCKET_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-download.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-download.md index c390616731..5186982a7c 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-download.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-download.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val result = storage.getFileDownload( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + val result = storage.getFileDownload( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-preview.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-preview.md index d2977d4618..d99e28ca94 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-preview.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-preview.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val result = storage.getFilePreview( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", -) + val storage = Storage(client) + val result = storage.getFilePreview( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-view.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-view.md index 49a3d65a24..433364a9c2 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-view.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file-view.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val result = storage.getFileView( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + val result = storage.getFileView( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file.md index 2057d11a63..ea76d6f4ac 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/get-file.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.getFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]" -) + val storage = Storage(client) + val response = storage.getFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-buckets.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-buckets.md index 20577467a3..36a0d83232 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-buckets.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-buckets.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.listBuckets( -) + val storage = Storage(client) + val response = storage.listBuckets( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-files.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-files.md index 577643d12e..d84bb4e8c6 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-files.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/list-files.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.listFiles( - bucketId = "[BUCKET_ID]", -) + val storage = Storage(client) + val response = storage.listFiles( + bucketId = "[BUCKET_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-bucket.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-bucket.md index 773a70aac2..ac25ad0a7f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-bucket.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-bucket.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.updateBucket( - bucketId = "[BUCKET_ID]", - name = "[NAME]", -) + val storage = Storage(client) + val response = storage.updateBucket( + bucketId = "[BUCKET_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-file.md b/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-file.md index ee24542019..a628b54b25 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-file.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/storage/update-file.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Storage -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val storage = Storage(client) - -val response = storage.updateFile( - bucketId = "[BUCKET_ID]", - fileId = "[FILE_ID]", -) + val storage = Storage(client) + val response = storage.updateFile( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/create-membership.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/create-membership.md index 19432ded9c..ebdd4f3034 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/create-membership.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/create-membership.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.createMembership( - teamId = "[TEAM_ID]", - email = "email@example.com", - roles = listOf(), - url = "https://example.com", -) + val teams = Teams(client) + val response = teams.createMembership( + teamId = "[TEAM_ID]", + email = "email@example.com", + roles = listOf(), + url = "https://example.com", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/create.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/create.md index e69108976c..4b5c5e00e8 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/create.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/create.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.create( - teamId = "[TEAM_ID]", - name = "[NAME]", -) + val teams = Teams(client) + val response = teams.create( + teamId = "[TEAM_ID]", + name = "[NAME]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete-membership.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete-membership.md index 1888701c84..fd5cd7485e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete-membership.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete-membership.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.deleteMembership( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]" -) + val teams = Teams(client) + val response = teams.deleteMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete.md index 05440a9702..3806a5e7b8 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/delete.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.delete( - teamId = "[TEAM_ID]" -) + val teams = Teams(client) + val response = teams.delete( + teamId = "[TEAM_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/get-membership.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/get-membership.md index 79f3b3d608..a0788b2489 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/get-membership.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/get-membership.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.getMembership( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]" -) + val teams = Teams(client) + val response = teams.getMembership( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/get.md index ddc6851da4..c8802a7133 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/get.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.get( - teamId = "[TEAM_ID]" -) + val teams = Teams(client) + val response = teams.get( + teamId = "[TEAM_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/list-memberships.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/list-memberships.md index 6bccd89218..a31428d100 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/list-memberships.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/list-memberships.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.listMemberships( - teamId = "[TEAM_ID]", -) + val teams = Teams(client) + val response = teams.listMemberships( + teamId = "[TEAM_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/list.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/list.md index 8670cc74a8..7aff26e811 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/list.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/list.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.list( -) + val teams = Teams(client) + val response = teams.list( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-roles.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-roles.md index b6bd4db63d..f76601adc4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-roles.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.updateMembershipRoles( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]", - roles = listOf() -) + val teams = Teams(client) + val response = teams.updateMembershipRoles( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + roles = listOf() + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-status.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-status.md index c57222d4c2..56b7dc71c3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-status.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update-membership-status.md @@ -1,16 +1,18 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token -val teams = Teams(client) - -val response = teams.updateMembershipStatus( - teamId = "[TEAM_ID]", - membershipId = "[MEMBERSHIP_ID]", - userId = "[USER_ID]", - secret = "[SECRET]" -) + val teams = Teams(client) + val response = teams.updateMembershipStatus( + teamId = "[TEAM_ID]", + membershipId = "[MEMBERSHIP_ID]", + userId = "[USER_ID]", + secret = "[SECRET]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update.md b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update.md index 50a315cba6..a558a35216 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/teams/update.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/teams/update.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Teams -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val teams = Teams(client) - -val response = teams.update( - teamId = "[TEAM_ID]", - name = "[NAME]" -) + val teams = Teams(client) + val response = teams.update( + teamId = "[TEAM_ID]", + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-argon2user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-argon2user.md index 6045e15524..13c9d289ce 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-argon2user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-argon2user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createArgon2User( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createArgon2User( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-bcrypt-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-bcrypt-user.md index fa4c6e96e2..061a7a8bac 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-bcrypt-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-bcrypt-user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createBcryptUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createBcryptUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-m-d5user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-m-d5user.md index 75e10456c6..e660302c03 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-m-d5user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-m-d5user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createMD5User( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createMD5User( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-p-h-pass-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-p-h-pass-user.md index 832d6a9bac..3434533569 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-p-h-pass-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-p-h-pass-user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createPHPassUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createPHPassUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-s-h-a-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-s-h-a-user.md index fc005e576f..f057c24860 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-s-h-a-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-s-h-a-user.md @@ -1,15 +1,17 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createSHAUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", -) + val users = Users(client) + val response = users.createSHAUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md index aba7d2e112..42bb6a6df4 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-modified-user.md @@ -1,18 +1,20 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createScryptModifiedUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", - passwordSalt = "[PASSWORD_SALT]", - passwordSaltSeparator = "[PASSWORD_SALT_SEPARATOR]", - passwordSignerKey = "[PASSWORD_SIGNER_KEY]", -) + val users = Users(client) + val response = users.createScryptModifiedUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + passwordSalt = "[PASSWORD_SALT]", + passwordSaltSeparator = "[PASSWORD_SALT_SEPARATOR]", + passwordSignerKey = "[PASSWORD_SIGNER_KEY]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-user.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-user.md index 7a30521bf7..28903db223 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-user.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create-scrypt-user.md @@ -1,20 +1,22 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.createScryptUser( - userId = "[USER_ID]", - email = "email@example.com", - password = "password", - passwordSalt = "[PASSWORD_SALT]", - passwordCpu = 0, - passwordMemory = 0, - passwordParallel = 0, - passwordLength = 0, -) + val users = Users(client) + val response = users.createScryptUser( + userId = "[USER_ID]", + email = "email@example.com", + password = "password", + passwordSalt = "[PASSWORD_SALT]", + passwordCpu = 0, + passwordMemory = 0, + passwordParallel = 0, + passwordLength = 0, + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/create.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/create.md index 0cb1c03d2a..a799a14a87 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/create.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/create.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.create( - userId = "[USER_ID]", -) + val users = Users(client) + val response = users.create( + userId = "[USER_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-session.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-session.md index 89dde91904..b02b7eda74 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-session.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-session.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.deleteSession( - userId = "[USER_ID]", - sessionId = "[SESSION_ID]" -) + val users = Users(client) + val response = users.deleteSession( + userId = "[USER_ID]", + sessionId = "[SESSION_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-sessions.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-sessions.md index 34ad3e3749..969f5f34b2 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete-sessions.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.deleteSessions( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.deleteSessions( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete.md index 779e7ab6f3..7d545cd5fc 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/delete.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/delete.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.delete( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.delete( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/get-prefs.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/get-prefs.md index c979a44a4e..681bc0053a 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/get-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/get-prefs.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.getPrefs( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.getPrefs( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/get.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/get.md index cd02bed1b2..85cf8cd484 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/get.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/get.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.get( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.get( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-logs.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-logs.md index 429db0477f..d3b02a11f0 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-logs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-logs.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.listLogs( - userId = "[USER_ID]", -) + val users = Users(client) + val response = users.listLogs( + userId = "[USER_ID]", + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-memberships.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-memberships.md index 2b23b42097..04c9d2b307 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-memberships.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-memberships.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.listMemberships( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.listMemberships( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-sessions.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-sessions.md index 0a6ff5a892..604d18b11f 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/list-sessions.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/list-sessions.md @@ -1,13 +1,15 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.listSessions( - userId = "[USER_ID]" -) + val users = Users(client) + val response = users.listSessions( + userId = "[USER_ID]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/list.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/list.md index 6bbe414b0a..4c6f4a8f96 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/list.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/list.md @@ -1,12 +1,14 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.list( -) + val users = Users(client) + val response = users.list( + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email-verification.md index 6027a384bf..f33c5a7a5e 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email-verification.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updateEmailVerification( - userId = "[USER_ID]", - emailVerification = false -) + val users = Users(client) + val response = users.updateEmailVerification( + userId = "[USER_ID]", + emailVerification = false + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email.md index 897aea58f1..eabab2f2af 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-email.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updateEmail( - userId = "[USER_ID]", - email = "email@example.com" -) + val users = Users(client) + val response = users.updateEmail( + userId = "[USER_ID]", + email = "email@example.com" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-name.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-name.md index 7b04e7de6d..f4ce93b30b 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-name.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-name.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updateName( - userId = "[USER_ID]", - name = "[NAME]" -) + val users = Users(client) + val response = users.updateName( + userId = "[USER_ID]", + name = "[NAME]" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-password.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-password.md index b5e10a84a7..6e6122e297 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-password.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-password.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updatePassword( - userId = "[USER_ID]", - password = "password" -) + val users = Users(client) + val response = users.updatePassword( + userId = "[USER_ID]", + password = "password" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone-verification.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone-verification.md index 40539addec..b237adbcbd 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone-verification.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone-verification.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updatePhoneVerification( - userId = "[USER_ID]", - phoneVerification = false -) + val users = Users(client) + val response = users.updatePhoneVerification( + userId = "[USER_ID]", + phoneVerification = false + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone.md index fe6427dbf9..eccd9009aa 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-phone.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updatePhone( - userId = "[USER_ID]", - number = "+12065550100" -) + val users = Users(client) + val response = users.updatePhone( + userId = "[USER_ID]", + number = "+12065550100" + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-prefs.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-prefs.md index 83442ad387..27c669b141 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-prefs.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-prefs.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updatePrefs( - userId = "[USER_ID]", - prefs = mapOf( "a" to "b" ) -) + val users = Users(client) + val response = users.updatePrefs( + userId = "[USER_ID]", + prefs = mapOf( "a" to "b" ) + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-status.md b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-status.md index ccf1495026..927e76bee3 100644 --- a/docs/examples/1.1.x/server-kotlin/kotlin/users/update-status.md +++ b/docs/examples/1.1.x/server-kotlin/kotlin/users/update-status.md @@ -1,14 +1,16 @@ import io.appwrite.Client import io.appwrite.services.Users -val client = Client(context) - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key +suspend fun main() { + val client = Client(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -val users = Users(client) - -val response = users.updateStatus( - userId = "[USER_ID]", - status = false -) + val users = Users(client) + val response = users.updateStatus( + userId = "[USER_ID]", + status = false + ) + val json = response.body?.string() +} \ No newline at end of file diff --git a/docs/examples/1.1.x/server-swift/examples/account/create-phone-verification.md b/docs/examples/1.1.x/server-swift/examples/account/create-phone-verification.md index 9730ff0e9e..79b76da109 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/create-phone-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/account/create-phone-verification.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.createPhoneVerification() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.createPhoneVerification() + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/create-recovery.md b/docs/examples/1.1.x/server-swift/examples/account/create-recovery.md index 7d17a3a507..e0048ea302 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/create-recovery.md +++ b/docs/examples/1.1.x/server-swift/examples/account/create-recovery.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.createRecovery( - email: "email@example.com", - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.createRecovery( + email: "email@example.com", + url: "https://example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/create-verification.md b/docs/examples/1.1.x/server-swift/examples/account/create-verification.md index 96dcd813e9..530dc6638d 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/create-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/account/create-verification.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.createVerification( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.createVerification( + url: "https://example.com" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/delete-session.md b/docs/examples/1.1.x/server-swift/examples/account/delete-session.md index 734d2bdd83..38cdf4ac38 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/delete-session.md +++ b/docs/examples/1.1.x/server-swift/examples/account/delete-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let result = try await account.deleteSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let result = try await account.deleteSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/delete-sessions.md b/docs/examples/1.1.x/server-swift/examples/account/delete-sessions.md index 95968a0745..3ea9dc10d8 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/delete-sessions.md +++ b/docs/examples/1.1.x/server-swift/examples/account/delete-sessions.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let result = try await account.deleteSessions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let result = try await account.deleteSessions() + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/get-prefs.md b/docs/examples/1.1.x/server-swift/examples/account/get-prefs.md index 95e0afe3a3..1585b2b940 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/get-prefs.md +++ b/docs/examples/1.1.x/server-swift/examples/account/get-prefs.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let preferences = try await account.getPrefs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let preferences = try await account.getPrefs() + print(String(describing: preferences) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/get-session.md b/docs/examples/1.1.x/server-swift/examples/account/get-session.md index 53c7e280d5..d21b42a702 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/get-session.md +++ b/docs/examples/1.1.x/server-swift/examples/account/get-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let session = try await account.getSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let session = try await account.getSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/get.md b/docs/examples/1.1.x/server-swift/examples/account/get.md index 78992d9b21..ddd54288e9 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/get.md +++ b/docs/examples/1.1.x/server-swift/examples/account/get.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.get() + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/list-logs.md b/docs/examples/1.1.x/server-swift/examples/account/list-logs.md index 990b507998..a2ec84cf53 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/list-logs.md +++ b/docs/examples/1.1.x/server-swift/examples/account/list-logs.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let logList = try await account.listLogs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let logList = try await account.listLogs() + print(String(describing: logList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/list-sessions.md b/docs/examples/1.1.x/server-swift/examples/account/list-sessions.md index 3e1fe0345a..49a90cae72 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/list-sessions.md +++ b/docs/examples/1.1.x/server-swift/examples/account/list-sessions.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let sessionList = try await account.listSessions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let sessionList = try await account.listSessions() + print(String(describing: sessionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-email.md b/docs/examples/1.1.x/server-swift/examples/account/update-email.md index 8b7ddeff06..ac546af4b3 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-email.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-email.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updateEmail( - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updateEmail( + email: "email@example.com", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-name.md b/docs/examples/1.1.x/server-swift/examples/account/update-name.md index e1e7a35634..aaaa1c5876 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-name.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-name.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updateName( - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updateName( + name: "[NAME]" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-password.md b/docs/examples/1.1.x/server-swift/examples/account/update-password.md index d6299e3b27..223891673b 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-password.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-password.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updatePassword( - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updatePassword( + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-phone-verification.md b/docs/examples/1.1.x/server-swift/examples/account/update-phone-verification.md index 34b002d966..47a2d00923 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-phone-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-phone-verification.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.updatePhoneVerification( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.updatePhoneVerification( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-phone.md b/docs/examples/1.1.x/server-swift/examples/account/update-phone.md index 24148c9d29..c126d7790b 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-phone.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-phone.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updatePhone( - phone: "+12065550100", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updatePhone( + phone: "+12065550100", + password: "password" + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-prefs.md b/docs/examples/1.1.x/server-swift/examples/account/update-prefs.md index 6eb5e09113..9babfecf18 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-prefs.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-prefs.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updatePrefs( - prefs: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updatePrefs( + prefs: [:] + ) + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-recovery.md b/docs/examples/1.1.x/server-swift/examples/account/update-recovery.md index 9d44547668..2814bf124f 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-recovery.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-recovery.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.updateRecovery( - userId: "[USER_ID]", - secret: "[SECRET]", - password: "password", - passwordAgain: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.updateRecovery( + userId: "[USER_ID]", + secret: "[SECRET]", + password: "password", + passwordAgain: "password" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-session.md b/docs/examples/1.1.x/server-swift/examples/account/update-session.md index c7df4e4626..8ce9c3ce79 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-session.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-session.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let session = try await account.updateSession( - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let session = try await account.updateSession( + sessionId: "[SESSION_ID]" + ) + print(String(describing: session) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-status.md b/docs/examples/1.1.x/server-swift/examples/account/update-status.md index 7998eee480..eb5a0fee27 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-status.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-status.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let account = try await account.updateStatus() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let account = try await account.updateStatus() + print(String(describing: account) +} diff --git a/docs/examples/1.1.x/server-swift/examples/account/update-verification.md b/docs/examples/1.1.x/server-swift/examples/account/update-verification.md index d325f03c52..b8255614e6 100644 --- a/docs/examples/1.1.x/server-swift/examples/account/update-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/account/update-verification.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let account = Account(client) - -let token = try await account.updateVerification( - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let account = Account(client) + let token = try await account.updateVerification( + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: token) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-browser.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-browser.md index 59e256ff91..fe5be8cfa4 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-browser.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-browser.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getBrowser( - code: "aa" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getBrowser( + code: "aa" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-credit-card.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-credit-card.md index 9bdc25edc7..ad5296d06c 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-credit-card.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-credit-card.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getCreditCard( - code: "amex" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getCreditCard( + code: "amex" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-favicon.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-favicon.md index e96239b5c4..c7cdfa7142 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-favicon.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-favicon.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getFavicon( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getFavicon( + url: "https://example.com" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-flag.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-flag.md index e50498c2a3..7e8e94b4c5 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-flag.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-flag.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getFlag( - code: "af" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getFlag( + code: "af" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-image.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-image.md index cd63a62744..63ba881d4b 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-image.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-image.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getImage( - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getImage( + url: "https://example.com" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-initials.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-initials.md index bfc06f838f..e783f5b47d 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-initials.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-initials.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getInitials() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getInitials() + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/avatars/get-q-r.md b/docs/examples/1.1.x/server-swift/examples/avatars/get-q-r.md index 99bc5be320..ae8d51c0a3 100644 --- a/docs/examples/1.1.x/server-swift/examples/avatars/get-q-r.md +++ b/docs/examples/1.1.x/server-swift/examples/avatars/get-q-r.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let avatars = Avatars(client) - -let byteBuffer = try await avatars.getQR( - text: "[TEXT]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let avatars = Avatars(client) + let byteBuffer = try await avatars.getQR( + text: "[TEXT]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-boolean-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-boolean-attribute.md index ef5e3bbdd1..2e8f78fa8c 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-boolean-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-boolean-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeBoolean = try await databases.createBooleanAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeBoolean = try await databases.createBooleanAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeBoolean) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-collection.md b/docs/examples/1.1.x/server-swift/examples/databases/create-collection.md index d406c194a5..2f279c853f 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-collection.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-collection.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let collection = try await databases.createCollection( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let collection = try await databases.createCollection( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + name: "[NAME]" + ) + print(String(describing: collection) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-datetime-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-datetime-attribute.md index 2baad28f56..f2487f996a 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-datetime-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-datetime-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeDatetime = try await databases.createDatetimeAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeDatetime = try await databases.createDatetimeAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeDatetime) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-document.md b/docs/examples/1.1.x/server-swift/examples/databases/create-document.md index 1d8f604c8d..b93d97ade2 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-document.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-document.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let document = try await databases.createDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]", - data: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let document = try await databases.createDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]", + data: [:] + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-email-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-email-attribute.md index 9e1746c5bd..c2bcb218dd 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-email-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-email-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeEmail = try await databases.createEmailAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeEmail = try await databases.createEmailAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeEmail) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-enum-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-enum-attribute.md index ba538ebcfd..def8bff0bc 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-enum-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-enum-attribute.md @@ -1,17 +1,18 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeEnum = try await databases.createEnumAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - elements: [], - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeEnum = try await databases.createEnumAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + elements: [], + required: xfalse + ) + print(String(describing: attributeEnum) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-float-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-float-attribute.md index bb456f6365..bc8c826356 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-float-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-float-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeFloat = try await databases.createFloatAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeFloat = try await databases.createFloatAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeFloat) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-index.md b/docs/examples/1.1.x/server-swift/examples/databases/create-index.md index 899c84211b..fc85de0092 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-index.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-index.md @@ -1,17 +1,18 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let index = try await databases.createIndex( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - type: "key", - attributes: [] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let index = try await databases.createIndex( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + type: "key", + attributes: [] + ) + print(String(describing: index) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-integer-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-integer-attribute.md index 1c75420075..d45bc4f4a4 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-integer-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-integer-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeInteger = try await databases.createIntegerAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeInteger = try await databases.createIntegerAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeInteger) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-ip-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-ip-attribute.md index b3e03c1dec..971ebcc919 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-ip-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-ip-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeIp = try await databases.createIpAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeIp = try await databases.createIpAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeIp) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-string-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-string-attribute.md index a8e21d5fae..784a859450 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-string-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-string-attribute.md @@ -1,17 +1,18 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeString = try await databases.createStringAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - size: 1, - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeString = try await databases.createStringAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + size: 1, + required: xfalse + ) + print(String(describing: attributeString) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create-url-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/create-url-attribute.md index 7f2be87184..25dcd2a9a6 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create-url-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create-url-attribute.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeUrl = try await databases.createUrlAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "", - required: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeUrl = try await databases.createUrlAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "", + required: xfalse + ) + print(String(describing: attributeUrl) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/create.md b/docs/examples/1.1.x/server-swift/examples/databases/create.md index 4852651442..5ad5331bf9 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/create.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/create.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let database = try await databases.create( - databaseId: "[DATABASE_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let database = try await databases.create( + databaseId: "[DATABASE_ID]", + name: "[NAME]" + ) + print(String(describing: database) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/delete-attribute.md index 2b1322efe7..78b4d81fae 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete-attribute.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.deleteAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.deleteAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete-collection.md b/docs/examples/1.1.x/server-swift/examples/databases/delete-collection.md index 30b1cbe9f6..b35a3e250d 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete-collection.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete-collection.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.deleteCollection( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.deleteCollection( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete-document.md b/docs/examples/1.1.x/server-swift/examples/databases/delete-document.md index c794afd4e3..57fb6db16b 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete-document.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete-document.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.deleteDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.deleteDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete-index.md b/docs/examples/1.1.x/server-swift/examples/databases/delete-index.md index a84a642528..eca8f48319 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete-index.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete-index.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.deleteIndex( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.deleteIndex( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/delete.md b/docs/examples/1.1.x/server-swift/examples/databases/delete.md index fefb4e3515..0cbfbb2dde 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/delete.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/delete.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.delete( - databaseId: "[DATABASE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.delete( + databaseId: "[DATABASE_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get-attribute.md b/docs/examples/1.1.x/server-swift/examples/databases/get-attribute.md index 18febcfe15..7b8c87def4 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get-attribute.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get-attribute.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let result = try await databases.getAttribute( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let result = try await databases.getAttribute( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get-collection.md b/docs/examples/1.1.x/server-swift/examples/databases/get-collection.md index 1e8c74612d..c21f6ecd61 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get-collection.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get-collection.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let collection = try await databases.getCollection( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let collection = try await databases.getCollection( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: collection) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get-document.md b/docs/examples/1.1.x/server-swift/examples/databases/get-document.md index c5e5962395..22f66b3551 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get-document.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get-document.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let document = try await databases.getDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let document = try await databases.getDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get-index.md b/docs/examples/1.1.x/server-swift/examples/databases/get-index.md index dc193c09a7..e23bd8109f 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get-index.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get-index.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let index = try await databases.getIndex( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - key: "" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let index = try await databases.getIndex( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + key: "" + ) + print(String(describing: index) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/get.md b/docs/examples/1.1.x/server-swift/examples/databases/get.md index 0b894d25c3..912005d73f 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/get.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/get.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let database = try await databases.get( - databaseId: "[DATABASE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let database = try await databases.get( + databaseId: "[DATABASE_ID]" + ) + print(String(describing: database) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list-attributes.md b/docs/examples/1.1.x/server-swift/examples/databases/list-attributes.md index 48dab7ebcc..f7894174d5 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list-attributes.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list-attributes.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let attributeList = try await databases.listAttributes( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let attributeList = try await databases.listAttributes( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: attributeList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list-collections.md b/docs/examples/1.1.x/server-swift/examples/databases/list-collections.md index efeb6561ca..8d0e0118ed 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list-collections.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list-collections.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let collectionList = try await databases.listCollections( - databaseId: "[DATABASE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let collectionList = try await databases.listCollections( + databaseId: "[DATABASE_ID]" + ) + print(String(describing: collectionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list-documents.md b/docs/examples/1.1.x/server-swift/examples/databases/list-documents.md index a2c49981dc..bdab597e99 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list-documents.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list-documents.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let documentList = try await databases.listDocuments( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let documentList = try await databases.listDocuments( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: documentList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list-indexes.md b/docs/examples/1.1.x/server-swift/examples/databases/list-indexes.md index 3c6767844f..57b5532b8c 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list-indexes.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list-indexes.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let indexList = try await databases.listIndexes( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let indexList = try await databases.listIndexes( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]" + ) + print(String(describing: indexList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/list.md b/docs/examples/1.1.x/server-swift/examples/databases/list.md index e7edfc6d0c..f777518fe3 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/list.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/list.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let databaseList = try await databases.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let databaseList = try await databases.list() + print(String(describing: databaseList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/update-collection.md b/docs/examples/1.1.x/server-swift/examples/databases/update-collection.md index 8e99729c8d..3861de183a 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/update-collection.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/update-collection.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let collection = try await databases.updateCollection( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let collection = try await databases.updateCollection( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + name: "[NAME]" + ) + print(String(describing: collection) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/update-document.md b/docs/examples/1.1.x/server-swift/examples/databases/update-document.md index 133f2c9c22..0ab31e301c 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/update-document.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/update-document.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let document = try await databases.updateDocument( - databaseId: "[DATABASE_ID]", - collectionId: "[COLLECTION_ID]", - documentId: "[DOCUMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let document = try await databases.updateDocument( + databaseId: "[DATABASE_ID]", + collectionId: "[COLLECTION_ID]", + documentId: "[DOCUMENT_ID]" + ) + print(String(describing: document) +} diff --git a/docs/examples/1.1.x/server-swift/examples/databases/update.md b/docs/examples/1.1.x/server-swift/examples/databases/update.md index 71473bff54..f33df0b6b4 100644 --- a/docs/examples/1.1.x/server-swift/examples/databases/update.md +++ b/docs/examples/1.1.x/server-swift/examples/databases/update.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let databases = Databases(client) - -let database = try await databases.update( - databaseId: "[DATABASE_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let databases = Databases(client) + let database = try await databases.update( + databaseId: "[DATABASE_ID]", + name: "[NAME]" + ) + print(String(describing: database) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create-build.md b/docs/examples/1.1.x/server-swift/examples/functions/create-build.md index da6f6c8572..4e0ed0e2ab 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create-build.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create-build.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let result = try await functions.createBuild( - functionId: "[FUNCTION_ID]", - deploymentId: "[DEPLOYMENT_ID]", - buildId: "[BUILD_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let result = try await functions.createBuild( + functionId: "[FUNCTION_ID]", + deploymentId: "[DEPLOYMENT_ID]", + buildId: "[BUILD_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create-deployment.md b/docs/examples/1.1.x/server-swift/examples/functions/create-deployment.md index f9a8a832ae..6ae7f688e6 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create-deployment.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create-deployment.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let deployment = try await functions.createDeployment( - functionId: "[FUNCTION_ID]", - entrypoint: "[ENTRYPOINT]", - code: InputFile.fromPath("file.png"), - activate: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let deployment = try await functions.createDeployment( + functionId: "[FUNCTION_ID]", + entrypoint: "[ENTRYPOINT]", + code: InputFile.fromPath("file.png"), + activate: xfalse + ) + print(String(describing: deployment) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create-execution.md b/docs/examples/1.1.x/server-swift/examples/functions/create-execution.md index 773763f568..02dde0c312 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create-execution.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create-execution.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let execution = try await functions.createExecution( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let execution = try await functions.createExecution( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: execution) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create-variable.md b/docs/examples/1.1.x/server-swift/examples/functions/create-variable.md index 02a383fb38..29a221c0e6 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create-variable.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create-variable.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let variable = try await functions.createVariable( - functionId: "[FUNCTION_ID]", - key: "[KEY]", - value: "[VALUE]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let variable = try await functions.createVariable( + functionId: "[FUNCTION_ID]", + key: "[KEY]", + value: "[VALUE]" + ) + print(String(describing: variable) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/create.md b/docs/examples/1.1.x/server-swift/examples/functions/create.md index 74695d314c..85a456040e 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/create.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/create.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let function = try await functions.create( - functionId: "[FUNCTION_ID]", - name: "[NAME]", - execute: ["any"], - runtime: "node-14.5" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let function = try await functions.create( + functionId: "[FUNCTION_ID]", + name: "[NAME]", + execute: ["any"], + runtime: "node-14.5" + ) + print(String(describing: function) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/delete-deployment.md b/docs/examples/1.1.x/server-swift/examples/functions/delete-deployment.md index a3a5dcd6e0..322c52b7ed 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/delete-deployment.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/delete-deployment.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let result = try await functions.deleteDeployment( - functionId: "[FUNCTION_ID]", - deploymentId: "[DEPLOYMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let result = try await functions.deleteDeployment( + functionId: "[FUNCTION_ID]", + deploymentId: "[DEPLOYMENT_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/delete-variable.md b/docs/examples/1.1.x/server-swift/examples/functions/delete-variable.md index 50767ee295..9feb18b3c2 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/delete-variable.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/delete-variable.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let result = try await functions.deleteVariable( - functionId: "[FUNCTION_ID]", - variableId: "[VARIABLE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let result = try await functions.deleteVariable( + functionId: "[FUNCTION_ID]", + variableId: "[VARIABLE_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/delete.md b/docs/examples/1.1.x/server-swift/examples/functions/delete.md index 62d733e3d2..c5628163da 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/delete.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/delete.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let result = try await functions.delete( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let result = try await functions.delete( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/get-deployment.md b/docs/examples/1.1.x/server-swift/examples/functions/get-deployment.md index c0058d8e87..c5322ee81b 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/get-deployment.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/get-deployment.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let deployment = try await functions.getDeployment( - functionId: "[FUNCTION_ID]", - deploymentId: "[DEPLOYMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let deployment = try await functions.getDeployment( + functionId: "[FUNCTION_ID]", + deploymentId: "[DEPLOYMENT_ID]" + ) + print(String(describing: deployment) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/get-execution.md b/docs/examples/1.1.x/server-swift/examples/functions/get-execution.md index 6a651a62c2..d5bcf092ac 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/get-execution.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/get-execution.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let execution = try await functions.getExecution( - functionId: "[FUNCTION_ID]", - executionId: "[EXECUTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let execution = try await functions.getExecution( + functionId: "[FUNCTION_ID]", + executionId: "[EXECUTION_ID]" + ) + print(String(describing: execution) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/get-variable.md b/docs/examples/1.1.x/server-swift/examples/functions/get-variable.md index bd3bd89813..fd814984e4 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/get-variable.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/get-variable.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let variable = try await functions.getVariable( - functionId: "[FUNCTION_ID]", - variableId: "[VARIABLE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let variable = try await functions.getVariable( + functionId: "[FUNCTION_ID]", + variableId: "[VARIABLE_ID]" + ) + print(String(describing: variable) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/get.md b/docs/examples/1.1.x/server-swift/examples/functions/get.md index 34739d5e60..6675916a47 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/get.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/get.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let function = try await functions.get( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let function = try await functions.get( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: function) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list-deployments.md b/docs/examples/1.1.x/server-swift/examples/functions/list-deployments.md index 450448d91c..fce719736a 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list-deployments.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list-deployments.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let deploymentList = try await functions.listDeployments( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let deploymentList = try await functions.listDeployments( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: deploymentList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list-executions.md b/docs/examples/1.1.x/server-swift/examples/functions/list-executions.md index 96e6e22eb1..95d27cbc05 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list-executions.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list-executions.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let executionList = try await functions.listExecutions( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let executionList = try await functions.listExecutions( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: executionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list-runtimes.md b/docs/examples/1.1.x/server-swift/examples/functions/list-runtimes.md index 194bb6efa9..e87ad2c46c 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list-runtimes.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list-runtimes.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let runtimeList = try await functions.listRuntimes() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let runtimeList = try await functions.listRuntimes() + print(String(describing: runtimeList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list-variables.md b/docs/examples/1.1.x/server-swift/examples/functions/list-variables.md index 581d5cf27a..8952aa6fcd 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list-variables.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list-variables.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let variableList = try await functions.listVariables( - functionId: "[FUNCTION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let variableList = try await functions.listVariables( + functionId: "[FUNCTION_ID]" + ) + print(String(describing: variableList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/list.md b/docs/examples/1.1.x/server-swift/examples/functions/list.md index ff509f6fb2..695350d95a 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/list.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/list.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let functionList = try await functions.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let functionList = try await functions.list() + print(String(describing: functionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/update-deployment.md b/docs/examples/1.1.x/server-swift/examples/functions/update-deployment.md index efee130564..37d8cbb8fd 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/update-deployment.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/update-deployment.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let function = try await functions.updateDeployment( - functionId: "[FUNCTION_ID]", - deploymentId: "[DEPLOYMENT_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let function = try await functions.updateDeployment( + functionId: "[FUNCTION_ID]", + deploymentId: "[DEPLOYMENT_ID]" + ) + print(String(describing: function) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/update-variable.md b/docs/examples/1.1.x/server-swift/examples/functions/update-variable.md index d377539dfa..ff22cc2bfd 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/update-variable.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/update-variable.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let variable = try await functions.updateVariable( - functionId: "[FUNCTION_ID]", - variableId: "[VARIABLE_ID]", - key: "[KEY]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let variable = try await functions.updateVariable( + functionId: "[FUNCTION_ID]", + variableId: "[VARIABLE_ID]", + key: "[KEY]" + ) + print(String(describing: variable) +} diff --git a/docs/examples/1.1.x/server-swift/examples/functions/update.md b/docs/examples/1.1.x/server-swift/examples/functions/update.md index 65300d1b06..c459ae38af 100644 --- a/docs/examples/1.1.x/server-swift/examples/functions/update.md +++ b/docs/examples/1.1.x/server-swift/examples/functions/update.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let functions = Functions(client) - -let function = try await functions.update( - functionId: "[FUNCTION_ID]", - name: "[NAME]", - execute: ["any"] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let functions = Functions(client) + let function = try await functions.update( + functionId: "[FUNCTION_ID]", + name: "[NAME]", + execute: ["any"] + ) + print(String(describing: function) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-antivirus.md b/docs/examples/1.1.x/server-swift/examples/health/get-antivirus.md index a7cf12a742..3eafa2c2f1 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-antivirus.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-antivirus.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthAntivirus = try await health.getAntivirus() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthAntivirus = try await health.getAntivirus() + print(String(describing: healthAntivirus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-cache.md b/docs/examples/1.1.x/server-swift/examples/health/get-cache.md index f49afe03d2..20831b4d39 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-cache.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-cache.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthStatus = try await health.getCache() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthStatus = try await health.getCache() + print(String(describing: healthStatus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-d-b.md b/docs/examples/1.1.x/server-swift/examples/health/get-d-b.md index 63a0e352e1..5808c99a73 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-d-b.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-d-b.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthStatus = try await health.getDB() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthStatus = try await health.getDB() + print(String(describing: healthStatus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-queue-certificates.md b/docs/examples/1.1.x/server-swift/examples/health/get-queue-certificates.md index 679cfce2a1..123b452f99 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-queue-certificates.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-queue-certificates.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthQueue = try await health.getQueueCertificates() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthQueue = try await health.getQueueCertificates() + print(String(describing: healthQueue) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-queue-functions.md b/docs/examples/1.1.x/server-swift/examples/health/get-queue-functions.md index 518f70a9e7..c3949a769c 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-queue-functions.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-queue-functions.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthQueue = try await health.getQueueFunctions() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthQueue = try await health.getQueueFunctions() + print(String(describing: healthQueue) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-queue-logs.md b/docs/examples/1.1.x/server-swift/examples/health/get-queue-logs.md index 710339ec78..6a36fa966c 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-queue-logs.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-queue-logs.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthQueue = try await health.getQueueLogs() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthQueue = try await health.getQueueLogs() + print(String(describing: healthQueue) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-queue-webhooks.md b/docs/examples/1.1.x/server-swift/examples/health/get-queue-webhooks.md index 6f5fbe7c1e..bc6b7bcb14 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-queue-webhooks.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-queue-webhooks.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthQueue = try await health.getQueueWebhooks() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthQueue = try await health.getQueueWebhooks() + print(String(describing: healthQueue) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-storage-local.md b/docs/examples/1.1.x/server-swift/examples/health/get-storage-local.md index 8fed07b7b7..773d8dd483 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-storage-local.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-storage-local.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthStatus = try await health.getStorageLocal() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthStatus = try await health.getStorageLocal() + print(String(describing: healthStatus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get-time.md b/docs/examples/1.1.x/server-swift/examples/health/get-time.md index 7c9d370506..edbc171ea9 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get-time.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get-time.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthTime = try await health.getTime() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthTime = try await health.getTime() + print(String(describing: healthTime) +} diff --git a/docs/examples/1.1.x/server-swift/examples/health/get.md b/docs/examples/1.1.x/server-swift/examples/health/get.md index 41a44b163e..770c09aa66 100644 --- a/docs/examples/1.1.x/server-swift/examples/health/get.md +++ b/docs/examples/1.1.x/server-swift/examples/health/get.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let health = Health(client) - -let healthStatus = try await health.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let health = Health(client) + let healthStatus = try await health.get() + print(String(describing: healthStatus) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/get.md b/docs/examples/1.1.x/server-swift/examples/locale/get.md index a0353af234..fd0a9dd1e7 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/get.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/get.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let locale = try await locale.get() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let locale = try await locale.get() + print(String(describing: locale) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-continents.md b/docs/examples/1.1.x/server-swift/examples/locale/list-continents.md index a74cedfc3c..2bd3007391 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-continents.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-continents.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let continentList = try await locale.listContinents() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let continentList = try await locale.listContinents() + print(String(describing: continentList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-countries-e-u.md b/docs/examples/1.1.x/server-swift/examples/locale/list-countries-e-u.md index fcb8fbf186..fd12103165 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-countries-e-u.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let countryList = try await locale.listCountriesEU() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let countryList = try await locale.listCountriesEU() + print(String(describing: countryList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-countries-phones.md b/docs/examples/1.1.x/server-swift/examples/locale/list-countries-phones.md index 04b3206469..e5a2c97ef2 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-countries-phones.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-countries-phones.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let phoneList = try await locale.listCountriesPhones() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let phoneList = try await locale.listCountriesPhones() + print(String(describing: phoneList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-countries.md b/docs/examples/1.1.x/server-swift/examples/locale/list-countries.md index 356580ba7b..cc38466e79 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-countries.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-countries.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let countryList = try await locale.listCountries() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let countryList = try await locale.listCountries() + print(String(describing: countryList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-currencies.md b/docs/examples/1.1.x/server-swift/examples/locale/list-currencies.md index 630958672f..26d272e536 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-currencies.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-currencies.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let currencyList = try await locale.listCurrencies() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let currencyList = try await locale.listCurrencies() + print(String(describing: currencyList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/locale/list-languages.md b/docs/examples/1.1.x/server-swift/examples/locale/list-languages.md index 33942e696b..63ccecf206 100644 --- a/docs/examples/1.1.x/server-swift/examples/locale/list-languages.md +++ b/docs/examples/1.1.x/server-swift/examples/locale/list-languages.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let locale = Locale(client) - -let languageList = try await locale.listLanguages() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let locale = Locale(client) + let languageList = try await locale.listLanguages() + print(String(describing: languageList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/create-bucket.md b/docs/examples/1.1.x/server-swift/examples/storage/create-bucket.md index 02eeabbec0..6f275b3123 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/create-bucket.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/create-bucket.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let bucket = try await storage.createBucket( - bucketId: "[BUCKET_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let bucket = try await storage.createBucket( + bucketId: "[BUCKET_ID]", + name: "[NAME]" + ) + print(String(describing: bucket) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/create-file.md b/docs/examples/1.1.x/server-swift/examples/storage/create-file.md index 471898cc75..2da22e5372 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/create-file.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/create-file.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let file = try await storage.createFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]", - file: InputFile.fromPath("file.png") -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let file = try await storage.createFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]", + file: InputFile.fromPath("file.png") + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/delete-bucket.md b/docs/examples/1.1.x/server-swift/examples/storage/delete-bucket.md index 018f6b798c..18687fb278 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/delete-bucket.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/delete-bucket.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let result = try await storage.deleteBucket( - bucketId: "[BUCKET_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let result = try await storage.deleteBucket( + bucketId: "[BUCKET_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/delete-file.md b/docs/examples/1.1.x/server-swift/examples/storage/delete-file.md index 9535648df6..305d6e1d81 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/delete-file.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/delete-file.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let result = try await storage.deleteFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let result = try await storage.deleteFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-bucket.md b/docs/examples/1.1.x/server-swift/examples/storage/get-bucket.md index a535fbe74a..f04e2db3c9 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-bucket.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-bucket.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let bucket = try await storage.getBucket( - bucketId: "[BUCKET_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let bucket = try await storage.getBucket( + bucketId: "[BUCKET_ID]" + ) + print(String(describing: bucket) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-file-download.md b/docs/examples/1.1.x/server-swift/examples/storage/get-file-download.md index 030b904c1b..28c427c620 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-file-download.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-file-download.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let byteBuffer = try await storage.getFileDownload( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let byteBuffer = try await storage.getFileDownload( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-file-preview.md b/docs/examples/1.1.x/server-swift/examples/storage/get-file-preview.md index 83e7be45be..20b87191e1 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-file-preview.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-file-preview.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let byteBuffer = try await storage.getFilePreview( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let byteBuffer = try await storage.getFilePreview( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-file-view.md b/docs/examples/1.1.x/server-swift/examples/storage/get-file-view.md index 7cefa52407..a17fba0a14 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-file-view.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-file-view.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let byteBuffer = try await storage.getFileView( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let byteBuffer = try await storage.getFileView( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: byteBuffer) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/get-file.md b/docs/examples/1.1.x/server-swift/examples/storage/get-file.md index 0a3e472cfc..6b02fcd0ee 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/get-file.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/get-file.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let file = try await storage.getFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let file = try await storage.getFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/list-buckets.md b/docs/examples/1.1.x/server-swift/examples/storage/list-buckets.md index 9958dbb410..361ef626b5 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/list-buckets.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/list-buckets.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let bucketList = try await storage.listBuckets() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let bucketList = try await storage.listBuckets() + print(String(describing: bucketList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/list-files.md b/docs/examples/1.1.x/server-swift/examples/storage/list-files.md index d7d63f9412..68a6ca40c4 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/list-files.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/list-files.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let fileList = try await storage.listFiles( - bucketId: "[BUCKET_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let fileList = try await storage.listFiles( + bucketId: "[BUCKET_ID]" + ) + print(String(describing: fileList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/update-bucket.md b/docs/examples/1.1.x/server-swift/examples/storage/update-bucket.md index a6aa0a7cca..3692deec5c 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/update-bucket.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/update-bucket.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let bucket = try await storage.updateBucket( - bucketId: "[BUCKET_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let bucket = try await storage.updateBucket( + bucketId: "[BUCKET_ID]", + name: "[NAME]" + ) + print(String(describing: bucket) +} diff --git a/docs/examples/1.1.x/server-swift/examples/storage/update-file.md b/docs/examples/1.1.x/server-swift/examples/storage/update-file.md index 579133ba05..12f8150085 100644 --- a/docs/examples/1.1.x/server-swift/examples/storage/update-file.md +++ b/docs/examples/1.1.x/server-swift/examples/storage/update-file.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let storage = Storage(client) - -let file = try await storage.updateFile( - bucketId: "[BUCKET_ID]", - fileId: "[FILE_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let storage = Storage(client) + let file = try await storage.updateFile( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + print(String(describing: file) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/create-membership.md b/docs/examples/1.1.x/server-swift/examples/teams/create-membership.md index d850862a5d..a732ec676a 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/create-membership.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/create-membership.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let membership = try await teams.createMembership( - teamId: "[TEAM_ID]", - email: "email@example.com", - roles: [], - url: "https://example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let membership = try await teams.createMembership( + teamId: "[TEAM_ID]", + email: "email@example.com", + roles: [], + url: "https://example.com" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/create.md b/docs/examples/1.1.x/server-swift/examples/teams/create.md index 78aac9db1d..80edd0cadc 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/create.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/create.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let team = try await teams.create( - teamId: "[TEAM_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let team = try await teams.create( + teamId: "[TEAM_ID]", + name: "[NAME]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/delete-membership.md b/docs/examples/1.1.x/server-swift/examples/teams/delete-membership.md index 67cf0f9013..84f3157550 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/delete-membership.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/delete-membership.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let result = try await teams.deleteMembership( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let result = try await teams.deleteMembership( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/delete.md b/docs/examples/1.1.x/server-swift/examples/teams/delete.md index da985f9285..d8808a6565 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/delete.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/delete.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let result = try await teams.delete( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let result = try await teams.delete( + teamId: "[TEAM_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/get-membership.md b/docs/examples/1.1.x/server-swift/examples/teams/get-membership.md index 387952b2f1..5d80e2143a 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/get-membership.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/get-membership.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let membership = try await teams.getMembership( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let membership = try await teams.getMembership( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/get.md b/docs/examples/1.1.x/server-swift/examples/teams/get.md index 05eb43bb71..d1c4500442 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/get.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/get.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let team = try await teams.get( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let team = try await teams.get( + teamId: "[TEAM_ID]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/list-memberships.md b/docs/examples/1.1.x/server-swift/examples/teams/list-memberships.md index 38d31f5119..809debaa14 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/list-memberships.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/list-memberships.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let membershipList = try await teams.listMemberships( - teamId: "[TEAM_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let membershipList = try await teams.listMemberships( + teamId: "[TEAM_ID]" + ) + print(String(describing: membershipList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/list.md b/docs/examples/1.1.x/server-swift/examples/teams/list.md index a189b2ab3c..3a9fa822ae 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/list.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/list.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let teamList = try await teams.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let teamList = try await teams.list() + print(String(describing: teamList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/update-membership-roles.md b/docs/examples/1.1.x/server-swift/examples/teams/update-membership-roles.md index 5b6a023888..fd0084786a 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/update-membership-roles.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/update-membership-roles.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let membership = try await teams.updateMembershipRoles( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]", - roles: [] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let membership = try await teams.updateMembershipRoles( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]", + roles: [] + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/update-membership-status.md b/docs/examples/1.1.x/server-swift/examples/teams/update-membership-status.md index e55d8f3ca7..4b6f3eda43 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/update-membership-status.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/update-membership-status.md @@ -1,16 +1,17 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token - -let teams = Teams(client) - -let membership = try await teams.updateMembershipStatus( - teamId: "[TEAM_ID]", - membershipId: "[MEMBERSHIP_ID]", - userId: "[USER_ID]", - secret: "[SECRET]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + let teams = Teams(client) + let membership = try await teams.updateMembershipStatus( + teamId: "[TEAM_ID]", + membershipId: "[MEMBERSHIP_ID]", + userId: "[USER_ID]", + secret: "[SECRET]" + ) + print(String(describing: membership) +} diff --git a/docs/examples/1.1.x/server-swift/examples/teams/update.md b/docs/examples/1.1.x/server-swift/examples/teams/update.md index 83f1040f37..683dfd4e30 100644 --- a/docs/examples/1.1.x/server-swift/examples/teams/update.md +++ b/docs/examples/1.1.x/server-swift/examples/teams/update.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let teams = Teams(client) - -let team = try await teams.update( - teamId: "[TEAM_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let teams = Teams(client) + let team = try await teams.update( + teamId: "[TEAM_ID]", + name: "[NAME]" + ) + print(String(describing: team) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-argon2user.md b/docs/examples/1.1.x/server-swift/examples/users/create-argon2user.md index 9524bd0654..f54ebb15ec 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-argon2user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-argon2user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createArgon2User( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createArgon2User( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-bcrypt-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-bcrypt-user.md index d8965a74d5..379bff9c85 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-bcrypt-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-bcrypt-user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createBcryptUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createBcryptUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-m-d5user.md b/docs/examples/1.1.x/server-swift/examples/users/create-m-d5user.md index 32e7812c2a..c1a057ec7b 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-m-d5user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-m-d5user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createMD5User( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createMD5User( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-p-h-pass-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-p-h-pass-user.md index af6e563395..4492272329 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-p-h-pass-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-p-h-pass-user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createPHPassUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createPHPassUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-s-h-a-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-s-h-a-user.md index a6b54bb718..f6b30066d1 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-s-h-a-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-s-h-a-user.md @@ -1,15 +1,16 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createSHAUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createSHAUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-modified-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-modified-user.md index e825f5176c..e5e84fd266 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-modified-user.md @@ -1,18 +1,19 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createScryptModifiedUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password", - passwordSalt: "[PASSWORD_SALT]", - passwordSaltSeparator: "[PASSWORD_SALT_SEPARATOR]", - passwordSignerKey: "[PASSWORD_SIGNER_KEY]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createScryptModifiedUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password", + passwordSalt: "[PASSWORD_SALT]", + passwordSaltSeparator: "[PASSWORD_SALT_SEPARATOR]", + passwordSignerKey: "[PASSWORD_SIGNER_KEY]" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-user.md b/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-user.md index b0364c1ae9..d0dc599cb5 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-user.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create-scrypt-user.md @@ -1,20 +1,21 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.createScryptUser( - userId: "[USER_ID]", - email: "email@example.com", - password: "password", - passwordSalt: "[PASSWORD_SALT]", - passwordCpu: 0, - passwordMemory: 0, - passwordParallel: 0, - passwordLength: 0 -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.createScryptUser( + userId: "[USER_ID]", + email: "email@example.com", + password: "password", + passwordSalt: "[PASSWORD_SALT]", + passwordCpu: 0, + passwordMemory: 0, + passwordParallel: 0, + passwordLength: 0 + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/create.md b/docs/examples/1.1.x/server-swift/examples/users/create.md index 780025439d..76b7f22076 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/create.md +++ b/docs/examples/1.1.x/server-swift/examples/users/create.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.create( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.create( + userId: "[USER_ID]" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/delete-session.md b/docs/examples/1.1.x/server-swift/examples/users/delete-session.md index 2b16ffeec9..50cbf470d3 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/delete-session.md +++ b/docs/examples/1.1.x/server-swift/examples/users/delete-session.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let result = try await users.deleteSession( - userId: "[USER_ID]", - sessionId: "[SESSION_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let result = try await users.deleteSession( + userId: "[USER_ID]", + sessionId: "[SESSION_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/delete-sessions.md b/docs/examples/1.1.x/server-swift/examples/users/delete-sessions.md index 3f0232a72a..a8b7802577 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/delete-sessions.md +++ b/docs/examples/1.1.x/server-swift/examples/users/delete-sessions.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let result = try await users.deleteSessions( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let result = try await users.deleteSessions( + userId: "[USER_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/delete.md b/docs/examples/1.1.x/server-swift/examples/users/delete.md index b9288ed7f9..f970492afa 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/delete.md +++ b/docs/examples/1.1.x/server-swift/examples/users/delete.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let result = try await users.delete( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let result = try await users.delete( + userId: "[USER_ID]" + ) + print(String(describing: result) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/get-prefs.md b/docs/examples/1.1.x/server-swift/examples/users/get-prefs.md index db810e80d0..d664dbbb0d 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/get-prefs.md +++ b/docs/examples/1.1.x/server-swift/examples/users/get-prefs.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let preferences = try await users.getPrefs( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let preferences = try await users.getPrefs( + userId: "[USER_ID]" + ) + print(String(describing: preferences) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/get.md b/docs/examples/1.1.x/server-swift/examples/users/get.md index 461c169f93..dc57a924ba 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/get.md +++ b/docs/examples/1.1.x/server-swift/examples/users/get.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.get( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.get( + userId: "[USER_ID]" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/list-logs.md b/docs/examples/1.1.x/server-swift/examples/users/list-logs.md index aea2a5791b..78386c8291 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/list-logs.md +++ b/docs/examples/1.1.x/server-swift/examples/users/list-logs.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let logList = try await users.listLogs( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let logList = try await users.listLogs( + userId: "[USER_ID]" + ) + print(String(describing: logList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/list-memberships.md b/docs/examples/1.1.x/server-swift/examples/users/list-memberships.md index 8b0150621f..5fea09e948 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/list-memberships.md +++ b/docs/examples/1.1.x/server-swift/examples/users/list-memberships.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let membershipList = try await users.listMemberships( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let membershipList = try await users.listMemberships( + userId: "[USER_ID]" + ) + print(String(describing: membershipList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/list-sessions.md b/docs/examples/1.1.x/server-swift/examples/users/list-sessions.md index f8ff1f2c85..4339fa1a2f 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/list-sessions.md +++ b/docs/examples/1.1.x/server-swift/examples/users/list-sessions.md @@ -1,13 +1,14 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let sessionList = try await users.listSessions( - userId: "[USER_ID]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let sessionList = try await users.listSessions( + userId: "[USER_ID]" + ) + print(String(describing: sessionList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/list.md b/docs/examples/1.1.x/server-swift/examples/users/list.md index 86afe6e2ab..7ea73d0515 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/list.md +++ b/docs/examples/1.1.x/server-swift/examples/users/list.md @@ -1,11 +1,12 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let userList = try await users.list() +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let userList = try await users.list() + print(String(describing: userList) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-email-verification.md b/docs/examples/1.1.x/server-swift/examples/users/update-email-verification.md index 175d9d7d18..be03932e77 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-email-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-email-verification.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updateEmailVerification( - userId: "[USER_ID]", - emailVerification: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updateEmailVerification( + userId: "[USER_ID]", + emailVerification: xfalse + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-email.md b/docs/examples/1.1.x/server-swift/examples/users/update-email.md index d5df526616..602191c6f0 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-email.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-email.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updateEmail( - userId: "[USER_ID]", - email: "email@example.com" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updateEmail( + userId: "[USER_ID]", + email: "email@example.com" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-name.md b/docs/examples/1.1.x/server-swift/examples/users/update-name.md index 74a64112ec..7fa3b543ec 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-name.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-name.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updateName( - userId: "[USER_ID]", - name: "[NAME]" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updateName( + userId: "[USER_ID]", + name: "[NAME]" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-password.md b/docs/examples/1.1.x/server-swift/examples/users/update-password.md index a548dbafd1..5a3bde40b6 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-password.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-password.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updatePassword( - userId: "[USER_ID]", - password: "password" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updatePassword( + userId: "[USER_ID]", + password: "password" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-phone-verification.md b/docs/examples/1.1.x/server-swift/examples/users/update-phone-verification.md index 0ecb62a9dc..7d9228e820 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-phone-verification.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-phone-verification.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updatePhoneVerification( - userId: "[USER_ID]", - phoneVerification: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updatePhoneVerification( + userId: "[USER_ID]", + phoneVerification: xfalse + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-phone.md b/docs/examples/1.1.x/server-swift/examples/users/update-phone.md index 222de7848e..0f23a815da 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-phone.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-phone.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updatePhone( - userId: "[USER_ID]", - number: "+12065550100" -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updatePhone( + userId: "[USER_ID]", + number: "+12065550100" + ) + print(String(describing: user) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-prefs.md b/docs/examples/1.1.x/server-swift/examples/users/update-prefs.md index 2c0d9431f0..78e8bc274e 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-prefs.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-prefs.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let preferences = try await users.updatePrefs( - userId: "[USER_ID]", - prefs: [:] -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let preferences = try await users.updatePrefs( + userId: "[USER_ID]", + prefs: [:] + ) + print(String(describing: preferences) +} diff --git a/docs/examples/1.1.x/server-swift/examples/users/update-status.md b/docs/examples/1.1.x/server-swift/examples/users/update-status.md index f28c8f2240..28dc7d7844 100644 --- a/docs/examples/1.1.x/server-swift/examples/users/update-status.md +++ b/docs/examples/1.1.x/server-swift/examples/users/update-status.md @@ -1,14 +1,15 @@ import Appwrite -let client = Client() - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - -let users = Users(client) - -let user = try await users.updateStatus( - userId: "[USER_ID]", - status: xfalse -) +func main() async throws { + let client = Client() + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + let users = Users(client) + let user = try await users.updateStatus( + userId: "[USER_ID]", + status: xfalse + ) + print(String(describing: user) +} From 4813e6b4d5c286ee23b1bd73fd07197de5c35d27 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 22 Nov 2022 19:32:35 +0000 Subject: [PATCH 39/76] feat: add console mode --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 5d36384140..95073df08b 100755 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,10 @@ COPY app/console /usr/local/src/console WORKDIR /usr/local/src/console ARG VITE_GA_PROJECT +ARG VITE_CONSOLE_MODE + ENV VITE_GA_PROJECT=$VITE_GA_PROJECT +ENV VITE_CONSOLE_MODE=$VITE_CONSOLE_MODE RUN npm ci RUN npm run build From 64ba896738ad21ad7831c5a8289c605a8cb600b4 Mon Sep 17 00:00:00 2001 From: gepd Date: Tue, 22 Nov 2022 17:05:04 -0300 Subject: [PATCH 40/76] bug fix: failure status shoudn't be nulled --- app/controllers/api/account.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 115948f710..534186d0a1 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -426,8 +426,6 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') throw new Exception(Exception::PROJECT_INVALID_FAILURE_URL); } - $state['failure'] = null; - $accessToken = $oauth2->getAccessToken($code); $refreshToken = $oauth2->getRefreshToken($code); $accessTokenExpiry = $oauth2->getAccessTokenExpiry($code); From dd5a424022765b381cb8bb3a551849484acfeafc Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 23 Nov 2022 03:05:45 +0530 Subject: [PATCH 41/76] chore: update submodule --- app/console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/console b/app/console index 4e2cecefb5..b1a81a390a 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 4e2cecefb571104f0dbbe5a578729f0e17a10242 +Subproject commit b1a81a390a05746701651fca49e0d853f430677c From ad1587872b6ec977ab55c4e03394d4e444c31722 Mon Sep 17 00:00:00 2001 From: Alex Patterson Date: Tue, 22 Nov 2022 18:49:31 -0500 Subject: [PATCH 42/76] remove dup line --- app/controllers/api/locale.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 3aee339dfe..6d824da055 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -40,7 +40,6 @@ App::get('/v1/locale') $output['countryCode'] = $record['country']['iso_code']; $output['country'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown')); $output['continent'] = $locale->getText('continents.' . strtolower($record['continent']['code']), $locale->getText('locale.country.unknown')); - $output['continent'] = (isset($continents[$record['continent']['code']])) ? $continents[$record['continent']['code']] : $locale->getText('locale.country.unknown'); $output['continentCode'] = $record['continent']['code']; $output['eu'] = (\in_array($record['country']['iso_code'], $eu)) ? true : false; From 56d8c176dda083ce9c35805cc39a4d9d5a06a56a Mon Sep 17 00:00:00 2001 From: Alex Patterson Date: Tue, 22 Nov 2022 18:54:50 -0500 Subject: [PATCH 43/76] add update to changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 6b7af775de..c1a9cfb75e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ - Fix Migration stopping scheduled functions [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Migration enabling OAuth providers with data by default [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Error pages when OAuth providers are disabled [#4704](https://github.com/appwrite/appwrite/pull/4704) +- Fix Locale API returning Unknown Content [#4761](https://github.com/appwrite/appwrite/pull/4761) # Version 1.1.0 ## Features From 5f80f87ba99f0f7c1243121a0577313fea488b9a Mon Sep 17 00:00:00 2001 From: Alex Patterson Date: Tue, 22 Nov 2022 19:00:07 -0500 Subject: [PATCH 44/76] fixed continent spelling --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c1a9cfb75e..571582f836 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,7 +6,7 @@ - Fix Migration stopping scheduled functions [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Migration enabling OAuth providers with data by default [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Error pages when OAuth providers are disabled [#4704](https://github.com/appwrite/appwrite/pull/4704) -- Fix Locale API returning Unknown Content [#4761](https://github.com/appwrite/appwrite/pull/4761) +- Fix Locale API returning Unknown continent [#4761](https://github.com/appwrite/appwrite/pull/4761) # Version 1.1.0 ## Features From bd0139ef3be3d60d3a981f1a723e34db1fb0819e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 23 Nov 2022 18:16:57 +1300 Subject: [PATCH 45/76] Make region optional with default of 'default' --- app/controllers/api/projects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index d1dfea7245..1e70a99fc6 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -59,7 +59,7 @@ App::post('/v1/projects') ->param('projectId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('teamId', '', new UID(), 'Team unique ID.') - ->param('region', '', new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn($config) => !$config['disabled']))), 'Project Region.') + ->param('region', 'default', new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn($config) => !$config['disabled']))), 'Project Region.', true) ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) ->param('logo', '', new Text(1024), 'Project logo.', true) ->param('url', '', new URL(), 'Project URL.', true) From 1e1ab2a8ae88a5a53a4d72ec72813c40035fe8fb Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 23 Nov 2022 18:22:44 +1300 Subject: [PATCH 46/76] Update changelog --- CHANGES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 6b7af775de..e1655b069c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ -# Version 1.1.1 +# Version 1.1.2 +## Changes +- Make `region` parameter optional with default for project create [#4763](https://github.com/appwrite/appwrite/pull/4763) +# Version 1.1.1 ## Bugs - Fix Deletes worker using incorrect device for file deletion [#4662](https://github.com/appwrite/appwrite/pull/4662) - Fix Migration for Stats adding the region attribute [#4704](https://github.com/appwrite/appwrite/pull/4704) From d7cdaa55659f72c3310465f8e2223777cfe060af Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 23 Nov 2022 12:22:46 +0530 Subject: [PATCH 47/76] fix project Id issues --- src/Appwrite/Usage/Calculators/TimeSeries.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Usage/Calculators/TimeSeries.php b/src/Appwrite/Usage/Calculators/TimeSeries.php index ce92b6462f..e0a12b443f 100644 --- a/src/Appwrite/Usage/Calculators/TimeSeries.php +++ b/src/Appwrite/Usage/Calculators/TimeSeries.php @@ -489,7 +489,7 @@ class TimeSeries extends Calculator $query .= "WHERE \"time\" > '{$start}' "; $query .= "AND \"time\" < '{$end}' "; $query .= "AND \"metric_type\"='counter' {$filters} "; - $query .= "GROUP BY time({$period['key']}), \"projectId\", \"projectInternalId\" {$groupBy} "; + $query .= "GROUP BY time({$period['key']}), \"projectId\" {$groupBy} "; $query .= "FILL(null)"; try { @@ -511,12 +511,9 @@ class TimeSeries extends Calculator } $value = (!empty($point['value'])) ? $point['value'] : 0; - if (empty($point['projectInternalId'] ?? null)) { - continue; - } $this->createOrUpdateMetric( - $point['projectInternalId'], + $point['projectId'], $point['time'], $period['key'], $metricUpdated, From 1a00e3829aedd6ac16b2e09d5bec8ac906e13c7c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 23 Nov 2022 13:40:51 +0545 Subject: [PATCH 48/76] fix hourly stats --- app/controllers/api/project.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 49b493f00a..58867bb49c 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -27,8 +27,8 @@ App::get('/v1/project/usage') if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { $periods = [ '24h' => [ - 'period' => '30m', - 'limit' => 48, + 'period' => '1h', + 'limit' => 24, ], '7d' => [ 'period' => '1d', @@ -82,7 +82,7 @@ App::get('/v1/project/usage') while ($backfill > 0) { $last = $limit - $backfill - 1; // array index of last added metric $diff = match ($period) { // convert period to seconds for unix timestamp math - '30m' => 1800, + '1h' => 3600, '1d' => 86400, }; $stats[$metric][] = [ From 089a1b295c4942b6a91ab298d79c2a54633ec50c Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Wed, 23 Nov 2022 09:41:48 +0100 Subject: [PATCH 49/76] Improve Executor client error handling --- app/workers/functions.php | 5 +---- src/Executor/Executor.php | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/workers/functions.php b/app/workers/functions.php index 2333cb315e..56baaf9d1e 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -84,7 +84,7 @@ Server::setResource('execute', function () { 'functionId' => $functionId, 'deploymentId' => $deploymentId, 'trigger' => $trigger, - 'status' => 'waiting', + 'status' => 'processing', 'statusCode' => 0, 'response' => '', 'stderr' => '', @@ -99,9 +99,6 @@ Server::setResource('execute', function () { } } - $execution->setAttribute('status', 'processing'); - $execution = $dbForProject->updateDocument('executions', $executionId, $execution); - $vars = array_reduce($function->getAttribute('vars', []), function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value'); return $carry; diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 5ca738c302..b8b1e8b4bf 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -94,7 +94,8 @@ class Executor $status = $response['headers']['status-code']; if ($status >= 400) { - throw new \Exception($response['body']['message'], $status); + $message = \is_string($response['body'] ? $response['body'] : $response['body']['message']); + throw new \Exception($message, $status); } return $response['body']; @@ -146,7 +147,8 @@ class Executor $status = $response['headers']['status-code']; if ($status >= 400) { - throw new \Exception($response['body']['message'], $status); + $message = \is_string($response['body'] ? $response['body'] : $response['body']['message']); + throw new \Exception($message, $status); } return $response['body']; From 6db93b6dfbe44730ca64b6ce6c82d0efb35f71ae Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Wed, 23 Nov 2022 09:43:30 +0100 Subject: [PATCH 50/76] Revert changes --- app/workers/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/workers/functions.php b/app/workers/functions.php index 56baaf9d1e..2333cb315e 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -84,7 +84,7 @@ Server::setResource('execute', function () { 'functionId' => $functionId, 'deploymentId' => $deploymentId, 'trigger' => $trigger, - 'status' => 'processing', + 'status' => 'waiting', 'statusCode' => 0, 'response' => '', 'stderr' => '', @@ -99,6 +99,9 @@ Server::setResource('execute', function () { } } + $execution->setAttribute('status', 'processing'); + $execution = $dbForProject->updateDocument('executions', $executionId, $execution); + $vars = array_reduce($function->getAttribute('vars', []), function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value'); return $carry; From 97bbe1a465e02e99334be00e9df4aac06836b4f2 Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Wed, 23 Nov 2022 09:45:06 +0100 Subject: [PATCH 51/76] Bug fix --- src/Executor/Executor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index b8b1e8b4bf..43b2228e1f 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -94,7 +94,7 @@ class Executor $status = $response['headers']['status-code']; if ($status >= 400) { - $message = \is_string($response['body'] ? $response['body'] : $response['body']['message']); + $message = \is_string($response['body']) ? $response['body'] : $response['body']['message']; throw new \Exception($message, $status); } @@ -147,7 +147,7 @@ class Executor $status = $response['headers']['status-code']; if ($status >= 400) { - $message = \is_string($response['body'] ? $response['body'] : $response['body']['message']); + $message = \is_string($response['body']) ? $response['body'] : $response['body']['message']; throw new \Exception($message, $status); } From b382031ae7eb11e2967a5dc193f4960071dd21aa Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 23 Nov 2022 18:43:48 +0100 Subject: [PATCH 52/76] chore: release 1.1.1 --- .gitmodules | 2 +- CHANGES.md | 1 + README-CN.md | 6 +++--- README.md | 6 +++--- app/console | 2 +- app/init.php | 2 +- src/Appwrite/Migration/Migration.php | 1 + 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitmodules b/.gitmodules index e9f13bb1ac..cef850ec0a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "app/console"] path = app/console url = https://github.com/appwrite/console - branch = 2.0.1 + branch = 2.0.2 diff --git a/CHANGES.md b/CHANGES.md index 1eff76d716..e623b660d0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,7 @@ # Version 1.1.2 ## Changes +- Released `appwrite/console` [2.0.2](https://github.com/appwrite/console/releases/tag/2.0.2) - Make `region` parameter optional with default for project create [#4763](https://github.com/appwrite/appwrite/pull/4763) - Fix session expiration, and expired session deletion [#4739](https://github.com/appwrite/appwrite/pull/4739) diff --git a/README-CN.md b/README-CN.md index 4f8156f2ce..6f00cebf10 100644 --- a/README-CN.md +++ b/README-CN.md @@ -64,7 +64,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.1.1 + appwrite/appwrite:1.1.2 ``` ### Windows @@ -76,7 +76,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.1.1 + appwrite/appwrite:1.1.2 ``` #### PowerShell @@ -86,7 +86,7 @@ docker run -it --rm , --volume /var/run/docker.sock:/var/run/docker.sock , --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw , --entrypoint="install" , - appwrite/appwrite:1.1.1 + appwrite/appwrite:1.1.2 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index 6942597115..0e613204c4 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.1.1 + appwrite/appwrite:1.1.2 ``` ### Windows @@ -87,7 +87,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.1.1 + appwrite/appwrite:1.1.2 ``` #### PowerShell @@ -97,7 +97,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.1.1 + appwrite/appwrite:1.1.2 ``` Once the Docker installation completes, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after installation completes. diff --git a/app/console b/app/console index f89584bdd4..af3d741ae8 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit f89584bdd4ba3de07fb54cecbc275b131e23a4fb +Subproject commit af3d741ae8f02c2e16b8b4ea4664a3f8970290fd diff --git a/app/init.php b/app/init.php index 50624c21c8..ef9246e362 100644 --- a/app/init.php +++ b/app/init.php @@ -95,7 +95,7 @@ const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate pe const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours const APP_CACHE_BUSTER = 501; -const APP_VERSION_STABLE = '1.1.1'; +const APP_VERSION_STABLE = '1.1.2'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 6c293723e1..bef6e5e603 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -47,6 +47,7 @@ abstract class Migration '1.0.3' => 'V15', '1.1.0' => 'V16', '1.1.1' => 'V16', + '1.1.2' => 'V16', ]; /** From 20c538ec836fe852aed8427af84112fae311bd95 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 23 Nov 2022 18:52:09 +0100 Subject: [PATCH 53/76] chore: update changelog --- CHANGES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 571582f836..3d8b658eea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# Version 1.1.2 +## Bugs +- Fix Locale API returning Unknown continent [#4761](https://github.com/appwrite/appwrite/pull/4761) + # Version 1.1.1 ## Bugs @@ -6,7 +10,6 @@ - Fix Migration stopping scheduled functions [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Migration enabling OAuth providers with data by default [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Error pages when OAuth providers are disabled [#4704](https://github.com/appwrite/appwrite/pull/4704) -- Fix Locale API returning Unknown continent [#4761](https://github.com/appwrite/appwrite/pull/4761) # Version 1.1.0 ## Features From 01556184c76490c63df0f9940ba2723b82c6913a Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 18 Nov 2022 12:24:04 -0800 Subject: [PATCH 54/76] Fix the default oauth paths to match the route --- CHANGES.md | 2 ++ app/controllers/api/account.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e4baaa503e..54f305700b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,9 @@ # Version 1.1.2 ## Changes - Make `region` parameter optional with default for project create [#4763](https://github.com/appwrite/appwrite/pull/4763) + ## Bugs +- Fix default oauth paths [#4725](https://github.com/appwrite/appwrite/pull/4725) - Fix session expiration, and expired session deletion [#4739](https://github.com/appwrite/appwrite/pull/4739) - Fix processing status on sync executions [#4737](https://github.com/appwrite/appwrite/pull/4737) - Fix Locale API returning Unknown continent [#4761](https://github.com/appwrite/appwrite/pull/4761) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 534186d0a1..45fb03062f 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -41,8 +41,8 @@ use Utopia\Validator\Assoc; use Utopia\Validator\Text; use Utopia\Validator\WhiteList; -$oauthDefaultSuccess = '/v1/auth/oauth2/success'; -$oauthDefaultFailure = '/v1/auth/oauth2/failure'; +$oauthDefaultSuccess = '/auth/oauth2/success'; +$oauthDefaultFailure = '/auth/oauth2/failure'; App::post('/v1/account') ->desc('Create Account') From bb01a6d817536ba63b220b23a396c3be96393bf0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 24 Nov 2022 11:23:59 +1300 Subject: [PATCH 55/76] Get default region param from env --- app/controllers/api/projects.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 1e70a99fc6..26c1e31dfc 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -59,7 +59,7 @@ App::post('/v1/projects') ->param('projectId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('teamId', '', new UID(), 'Team unique ID.') - ->param('region', 'default', new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn($config) => !$config['disabled']))), 'Project Region.', true) + ->param('region', '', new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn($config) => !$config['disabled']))), 'Project Region.', true) ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) ->param('logo', '', new Text(1024), 'Project logo.', true) ->param('url', '', new URL(), 'Project URL.', true) @@ -92,6 +92,10 @@ App::post('/v1/projects') throw new Exception(Exception::PROJECT_RESERVED_PROJECT, "'console' is a reserved project."); } + if (\empty($region)) { + $region = App::getEnv('_APP_REGION', 'default'); + } + $project = $dbForConsole->createDocument('projects', new Document([ '$id' => $projectId, '$permissions' => [ From efe093ce3c7fbac574d58414a487df40714b6959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 24 Nov 2022 12:35:26 +0100 Subject: [PATCH 56/76] Fix unsaved changes in team inv --- app/controllers/api/teams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index dd214f562c..eb020202b7 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -724,7 +724,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->setAttribute('confirm', true) ; - $user->setAttribute('emailVerification', true); + $user = $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true)); // Log user in From 5e872f2fe57a0f1b8ade1028a74cfb2c8bb7cc82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 24 Nov 2022 12:36:14 +0100 Subject: [PATCH 57/76] Update changelog --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 54f305700b..086b28b5b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,5 @@ +- Fix invited account verified status [#4776](https://github.com/appwrite/appwrite/pull/4776) + # Version 1.1.2 ## Changes - Make `region` parameter optional with default for project create [#4763](https://github.com/appwrite/appwrite/pull/4763) From 0cb2ed14f444bc319d081d8350db0b2312e3f283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 24 Nov 2022 12:40:17 +0100 Subject: [PATCH 58/76] Improve tests --- tests/e2e/Services/Teams/TeamsBaseClient.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index c5ecf9f7fc..788626b102 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -342,6 +342,15 @@ trait TeamsBaseClient $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; $data['session'] = $session; + $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ])); + + $this->assertEquals(true, $response['body']['emailVerification']); + /** [START] TESTS TO CHECK PASSWORD UPDATE OF NEW USER CREATED USING TEAM INVITE */ /** From 8b71e318c2c402da010e85a612461cadaf7df1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 24 Nov 2022 11:55:49 +0000 Subject: [PATCH 59/76] Fix tests bug --- app/controllers/api/teams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index eb020202b7..567560c6a8 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -724,7 +724,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->setAttribute('confirm', true) ; - $user = $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true)); + $user = Authorization::skip(fn() => $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true))); // Log user in From de38fed306a2352546c386549861fb5f5bc53f73 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 25 Nov 2022 10:29:22 +1300 Subject: [PATCH 60/76] Fix empty check --- app/controllers/api/projects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 26c1e31dfc..e56b6c5cd8 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -92,7 +92,7 @@ App::post('/v1/projects') throw new Exception(Exception::PROJECT_RESERVED_PROJECT, "'console' is a reserved project."); } - if (\empty($region)) { + if (empty($region)) { $region = App::getEnv('_APP_REGION', 'default'); } From 6070e1de54df6519ef67637b846fa00b058a40b1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 25 Nov 2022 10:37:11 +1300 Subject: [PATCH 61/76] Add defaulted region test --- .../Projects/ProjectsConsoleClientTest.php | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index cd9f032d62..413b665897 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -55,6 +55,23 @@ class ProjectsConsoleClientTest extends Scope $projectId = $response['body']['$id']; + $response = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'projectId' => ID::unique(), + 'name' => 'Project Test', + 'teamId' => $team['body']['$id'], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('Project Test', $response['body']['name']); + $this->assertEquals($team['body']['$id'], $response['body']['teamId']); + $this->assertArrayHasKey('platforms', $response['body']); + $this->assertArrayHasKey('webhooks', $response['body']); + $this->assertArrayHasKey('keys', $response['body']); + /** * Test for FAILURE */ @@ -116,9 +133,9 @@ class ProjectsConsoleClientTest extends Scope ])); $this->assertEquals($response['headers']['status-code'], 200); - $this->assertEquals($response['body']['total'], 1); + $this->assertEquals($response['body']['total'], 2); $this->assertIsArray($response['body']['projects']); - $this->assertCount(1, $response['body']['projects']); + $this->assertCount(2, $response['body']['projects']); $this->assertEquals($response['body']['projects'][0]['name'], 'Project Test'); $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ @@ -129,9 +146,9 @@ class ProjectsConsoleClientTest extends Scope ])); $this->assertEquals($response['headers']['status-code'], 200); - $this->assertEquals($response['body']['total'], 1); + $this->assertEquals($response['body']['total'], 2); $this->assertIsArray($response['body']['projects']); - $this->assertCount(1, $response['body']['projects']); + $this->assertCount(2, $response['body']['projects']); $this->assertEquals($response['body']['projects'][0]['$id'], $data['projectId']); /** @@ -195,7 +212,7 @@ class ProjectsConsoleClientTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [ 'offset(1)' ], + 'queries' => [ 'offset(2)' ], ]); $this->assertEquals(200, $response['headers']['status-code']); @@ -224,7 +241,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); - $this->assertCount(2, $response['body']['projects']); + $this->assertCount(3, $response['body']['projects']); $this->assertEquals('Project Test 2', $response['body']['projects'][0]['name']); $this->assertEquals('Project Test', $response['body']['projects'][1]['name']); @@ -235,9 +252,9 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); - $this->assertCount(2, $response['body']['projects']); + $this->assertCount(3, $response['body']['projects']); $this->assertEquals('Project Test', $response['body']['projects'][0]['name']); - $this->assertEquals('Project Test 2', $response['body']['projects'][1]['name']); + $this->assertEquals('Project Test 2', $response['body']['projects'][2]['name']); $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ 'content-type' => 'application/json', @@ -248,8 +265,8 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); - $this->assertCount(1, $response['body']['projects']); - $this->assertEquals('Project Test 2', $response['body']['projects'][0]['name']); + $this->assertCount(2, $response['body']['projects']); + $this->assertEquals('Project Test 2', $response['body']['projects'][1]['name']); $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ 'content-type' => 'application/json', From 9d0cbd3b6817864616c187c56c01e965596fbf9b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 25 Nov 2022 10:39:53 +1300 Subject: [PATCH 62/76] Update changelog --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e1655b069c..1668f1c046 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# Version 1.2.0 +## Changes +- Get default region from environment on project create [#4780](https://github.com/appwrite/appwrite/pull/4780) + # Version 1.1.2 ## Changes - Make `region` parameter optional with default for project create [#4763](https://github.com/appwrite/appwrite/pull/4763) From f44a6429981d0d3e49de75eeb2d7e944cbd64072 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 25 Nov 2022 17:27:19 +1300 Subject: [PATCH 63/76] Get from env in param call --- app/controllers/api/projects.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index e56b6c5cd8..1fc60c3725 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -59,7 +59,7 @@ App::post('/v1/projects') ->param('projectId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('teamId', '', new UID(), 'Team unique ID.') - ->param('region', '', new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn($config) => !$config['disabled']))), 'Project Region.', true) + ->param('region', App::getEnv('_APP_REGION', 'default'), new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn($config) => !$config['disabled']))), 'Project Region.', true) ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) ->param('logo', '', new Text(1024), 'Project logo.', true) ->param('url', '', new URL(), 'Project URL.', true) @@ -92,10 +92,6 @@ App::post('/v1/projects') throw new Exception(Exception::PROJECT_RESERVED_PROJECT, "'console' is a reserved project."); } - if (empty($region)) { - $region = App::getEnv('_APP_REGION', 'default'); - } - $project = $dbForConsole->createDocument('projects', new Document([ '$id' => $projectId, '$permissions' => [ From 4dfaa5e69ace071f2917a8417103ac8ddcd496b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 5 Dec 2022 14:54:13 +0000 Subject: [PATCH 64/76] Fix mimetype size --- app/config/collections.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/collections.php b/app/config/collections.php index bdc14d9105..e872953568 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3256,7 +3256,7 @@ $collections = [ '$id' => ID::custom('mimeType'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 127, // https://tools.ietf.org/html/rfc4288#section-4.2 + 'size' => 255, // https://tools.ietf.org/html/rfc4288#section-4.2 'signed' => true, 'required' => false, 'default' => null, From ea58cb4aff4dab9936042ab1d79ac88de8c4cbff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 5 Dec 2022 14:57:24 +0000 Subject: [PATCH 65/76] Update changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 0ba56af243..e9b8ed761f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ - Fix invited account verified status [#4776](https://github.com/appwrite/appwrite/pull/4776) - Get default region from environment on project create [#4780](https://github.com/appwrite/appwrite/pull/4780) +- Fix max mimetype size [#4814](https://github.com/appwrite/appwrite/pull/4814) # Version 1.1.2 ## Changes From 0a177713f06c54a4107f0b90ac3a1ce5d6de4485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 7 Dec 2022 11:01:58 +0000 Subject: [PATCH 66/76] Implement migration for mimeType --- src/Appwrite/Migration/Migration.php | 1 + src/Appwrite/Migration/Version/V17.php | 79 ++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 src/Appwrite/Migration/Version/V17.php diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index bef6e5e603..b764641279 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -48,6 +48,7 @@ abstract class Migration '1.1.0' => 'V16', '1.1.1' => 'V16', '1.1.2' => 'V16', + '1.2.0' => 'V17', ]; /** diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php new file mode 100644 index 0000000000..b04aa2a7c3 --- /dev/null +++ b/src/Appwrite/Migration/Version/V17.php @@ -0,0 +1,79 @@ + null, + fn () => [] + ); + } + + Console::log('Migrating Project: ' . $this->project->getAttribute('name') . ' (' . $this->project->getId() . ')'); + + Console::info('Migrating Collections'); + $this->migrateCollections(); + + // Console::info('Migrating Documents'); + // $this->forEachDocument([$this, 'fixDocument']); + } + + /** + * Migrate all Collections. + * + * @return void + */ + protected function migrateCollections(): void + { + foreach ($this->collections as $collection) { + $id = $collection['$id']; + + Console::log("Migrating Collection \"{$id}\""); + + $this->projectDB->setNamespace("_{$this->project->getInternalId()}"); + + switch ($id) { + case 'files': + try { + /** + * Update 'mimeType' attribute size (127->255) + */ + $this->projectDB->updateAttribute($id, 'mimeType', Database::VAR_STRING, 255, true, false); + } catch (\Throwable $th) { + Console::warning("'mimeType' from {$id}: {$th->getMessage()}"); + } + + break; + + default: + break; + } + + usleep(50000); + } + } + + /** + * Fix run on each document + * + * @param \Utopia\Database\Document $document + * @return \Utopia\Database\Document + */ + protected function fixDocument(Document $document) + { + return $document; + } +} From 674c23dfdeb29a0337b40cfb65f59500fc14105c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 7 Dec 2022 15:40:14 +0400 Subject: [PATCH 67/76] feat: update submodule --- app/console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/console b/app/console index b1a81a390a..c1ac63889c 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit b1a81a390a05746701651fca49e0d853f430677c +Subproject commit c1ac63889c0a97b280599355e526669bb207880a From 46593778c9edb7b7d9e0bd0921a959b4d7e64157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 9 Dec 2022 19:51:21 +0100 Subject: [PATCH 68/76] Fix event-triggered executions syntax error --- app/workers/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/functions.php b/app/workers/functions.php index 2333cb315e..31e64a2bb4 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -276,7 +276,7 @@ $server->job() queueForFunctions: $queueForFunctions, trigger: 'event', event: $events[0], - eventData: $eventData, + eventData: \is_string($eventData) ? $eventData : \json_encode($eventData), user: $user, data: null, executionId: null, From 6279784009cb602eb5f86c3900d7caa7cf5ebe39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 14 Dec 2022 09:44:40 +0100 Subject: [PATCH 69/76] Fix expired session, schedule deletes --- .env | 4 ++-- app/workers/deletes.php | 51 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/.env b/.env index f042b1686d..fee6c6653d 100644 --- a/.env +++ b/.env @@ -24,7 +24,7 @@ _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password _APP_DB_ROOT_PASS=rootsecretpassword -_APP_CONNECTIONS_MAX=251 +_APP_CONNECTIONS_MAX=3100 _APP_POOL_CLIENTS=14 _APP_CONNECTIONS_DB_PROJECT=db_fra1_02=mariadb://user:password@mariadb:3306/appwrite _APP_CONNECTIONS_DB_CONSOLE=db_fra1_01=mariadb://user:password@mariadb:3306/appwrite @@ -64,7 +64,7 @@ _APP_MAINTENANCE_RETENTION_CACHE=2592000 _APP_MAINTENANCE_RETENTION_EXECUTION=1209600 _APP_MAINTENANCE_RETENTION_ABUSE=86400 _APP_MAINTENANCE_RETENTION_AUDIT=1209600 -_APP_MAINTENANCE_RETENTION_SCHEDULES=86400 +_APP_MAINTENANCE_RETENTION_SCHEDULES=600 _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 _APP_USAGE_STATS=enabled _APP_USAGE_AGGREGATION_INTERVAL=30 diff --git a/app/workers/deletes.php b/app/workers/deletes.php index b8efa38ae6..458b341a45 100644 --- a/app/workers/deletes.php +++ b/app/workers/deletes.php @@ -134,8 +134,7 @@ class DeletesV1 extends Worker */ protected function deleteSchedules(string $datetime): void { - - $this->deleteByGroup( + $this->listByGroup( 'schedules', [ Query::equal('region', [App::getEnv('_APP_REGION', 'default')]), @@ -145,7 +144,6 @@ class DeletesV1 extends Worker ], $this->getConsoleDB(), function (Document $document) { - Console::info('Querying schedule for function ' . $document->getAttribute('resourceId')); $project = $this->getConsoleDB()->getDocument('projects', $document->getAttribute('projectId')); if ($project->isEmpty()) { @@ -358,8 +356,15 @@ class DeletesV1 extends Worker protected function deleteExpiredSessions(): void { - $this->deleteForProjectIds(function (Document $project) use ($datetime) { + $consoleDB = $this->getConsoleDB(); + + $this->deleteForProjectIds(function (Document $project) use ($consoleDB) { $dbForProject = $this->getProjectDB($project); + + $project = $consoleDB->getDocument('projects', $project->getId()); + $duration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG; + $expired = DateTime::addSeconds(new \DateTime(), -1 * $duration); + // Delete Sessions $this->deleteByGroup('sessions', [ Query::lessThan('$createdAt', $expired) @@ -569,6 +574,7 @@ class DeletesV1 extends Worker */ protected function deleteForProjectIds(callable $callback): void { + // TODO: @Meldiron name of this method no longer matches. It does not delete, and it gives whole document $count = 0; $chunk = 0; $limit = 50; @@ -632,6 +638,43 @@ class DeletesV1 extends Worker Console::info("Deleted {$count} document by group in " . ($executionEnd - $executionStart) . " seconds"); } + /** + * @param string $collection collectionID + * @param Query[] $queries + * @param Database $database + * @param callable $callback + */ + protected function listByGroup(string $collection, array $queries, Database $database, callable $callback = null): void + { + $count = 0; + $chunk = 0; + $limit = 50; + $results = []; + $sum = $limit; + + $executionStart = \microtime(true); + + while ($sum === $limit) { + $chunk++; + + $results = $database->find($collection, \array_merge([Query::limit($limit)], $queries)); + + $sum = count($results); + + foreach ($results as $document) { + if (is_callable($callback)) { + $callback($document); + } + + $count++; + } + } + + $executionEnd = \microtime(true); + + Console::info("Listed {$count} document by group in " . ($executionEnd - $executionStart) . " seconds"); + } + /** * @param Document $document certificates document */ From 41a6a6dbf79273a7143b410b0dc69d78a2cd60a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 14 Dec 2022 09:51:28 +0100 Subject: [PATCH 70/76] Add patch CLI task --- bin/create-missing-schedules | 3 + src/Appwrite/Platform/Services/Tasks.php | 2 + .../Platform/Tasks/CreateMissingSchedules.php | 97 +++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 bin/create-missing-schedules create mode 100644 src/Appwrite/Platform/Tasks/CreateMissingSchedules.php diff --git a/bin/create-missing-schedules b/bin/create-missing-schedules new file mode 100644 index 0000000000..41750b163c --- /dev/null +++ b/bin/create-missing-schedules @@ -0,0 +1,3 @@ +#!/bin/sh + +php /usr/src/code/app/cli.php create-missing-schedules $@ \ No newline at end of file diff --git a/src/Appwrite/Platform/Services/Tasks.php b/src/Appwrite/Platform/Services/Tasks.php index 2968a66b95..e6919f2cc7 100644 --- a/src/Appwrite/Platform/Services/Tasks.php +++ b/src/Appwrite/Platform/Services/Tasks.php @@ -8,6 +8,7 @@ use Appwrite\Platform\Tasks\Install; use Appwrite\Platform\Tasks\Maintenance; use Appwrite\Platform\Tasks\Migrate; use Appwrite\Platform\Tasks\Schedule; +use Appwrite\Platform\Tasks\CreateMissingSchedules; use Appwrite\Platform\Tasks\SDKs; use Appwrite\Platform\Tasks\Specs; use Appwrite\Platform\Tasks\SSL; @@ -29,6 +30,7 @@ class Tasks extends Service ->addAction(Doctor::getName(), new Doctor()) ->addAction(Install::getName(), new Install()) ->addAction(Maintenance::getName(), new Maintenance()) + ->addAction(CreateMissingSchedules::getName(), new CreateMissingSchedules()) ->addAction(Schedule::getName(), new Schedule()) ->addAction(Migrate::getName(), new Migrate()) ->addAction(SDKs::getName(), new SDKs()) diff --git a/src/Appwrite/Platform/Tasks/CreateMissingSchedules.php b/src/Appwrite/Platform/Tasks/CreateMissingSchedules.php new file mode 100644 index 0000000000..75e1d5b637 --- /dev/null +++ b/src/Appwrite/Platform/Tasks/CreateMissingSchedules.php @@ -0,0 +1,97 @@ +desc('Ensure every function has a schedule') + ->inject('dbForConsole') + ->inject('getProjectDB') + ->callback(fn (Database $dbForConsole, callable $getProjectDB) => $this->action($dbForConsole, $getProjectDB)); + } + + /** + * Iterate over every function on every project to make sure there is a schedule. If not, recreate the schedule. + */ + public function action(Database $dbForConsole, callable $getProjectDB): void + { + Authorization::disable(); + Authorization::setDefaultStatus(false); + + Console::title('CreateMissingSchedules V1'); + Console::success(APP_NAME . ' CreateMissingSchedules v1 has started'); + + $limit = 100; + $projectCursor = null; + while (true) { + $projectsQueries = [Query::limit($limit)]; + if ($projectCursor !== null) { + $projectsQueries[] = Query::cursorAfter($projectCursor); + } + $projects = $dbForConsole->find('projects', $projectsQueries); + + if (count($projects) === 0) { + break; + } + + foreach ($projects as $project) { + Console::log("Checking Project " . $project->getAttribute('name') . " (" . $project->getId() . ")"); + $dbForProject = $getProjectDB($project); + $functionCursor = null; + + while (true) { + $functionsQueries = [Query::limit($limit)]; + if ($functionCursor !== null) { + $functionsQueries[] = Query::cursorAfter($functionCursor); + } + $functions = $dbForProject->find('functions', $functionsQueries); + if (count($functions) === 0) { + break; + } + + foreach ($functions as $function) { + $scheduleId = $function->getAttribute('scheduleId'); + $schedule = $dbForConsole->getDocument('schedules', $scheduleId); + + if ($schedule->isEmpty()) { + $functionId = $function->getId(); + $schedule = $dbForConsole->createDocument('schedules', new Document([ + '$id' => ID::custom($scheduleId), + 'region' => $project->getAttribute('region', 'default'), + 'resourceType' => 'function', + 'resourceId' => $functionId, + 'resourceUpdatedAt' => DateTime::now(), + 'projectId' => $project->getId(), + 'schedule' => $function->getAttribute('schedule'), + 'active' => !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment')), + ])); + + Console::success('Recreated schedule for function ' . $functionId); + } + } + + $functionCursor = $functions[array_key_last($functions)]; + } + } + + $projectCursor = $projects[array_key_last($projects)]; + } + } +} From 11b3abebd1f57f4f32f9f644b6b07d84d28111fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 14 Dec 2022 09:58:45 +0100 Subject: [PATCH 71/76] Remove tcp setup --- docker-compose.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6c040df4cc..7620039b63 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,15 +33,6 @@ services: - 8080:80 - 443:443 - 9500:8080 - ulimits: - nofile: - soft: 655350 - hard: 655350 - sysctls: - - net.core.somaxconn=1024 - - net.ipv4.tcp_rmem=1024 4096 16384 - - net.ipv4.tcp_wmem=1024 4096 16384 - - net.ipv4.ip_local_port_range=1025 65535 volumes: - /var/run/docker.sock:/var/run/docker.sock - appwrite-config:/storage/config:ro From 3d07600a48b1d0d709a571703409221268711f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 14 Dec 2022 10:44:46 +0100 Subject: [PATCH 72/76] PR review changes --- bin/create-missing-schedules | 3 --- bin/patch-create-missing-schedules | 3 +++ src/Appwrite/Platform/Services/Tasks.php | 4 ++-- ...ssingSchedules.php => PatchCreateMissingSchedules.php} | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 bin/create-missing-schedules create mode 100644 bin/patch-create-missing-schedules rename src/Appwrite/Platform/Tasks/{CreateMissingSchedules.php => PatchCreateMissingSchedules.php} (93%) diff --git a/bin/create-missing-schedules b/bin/create-missing-schedules deleted file mode 100644 index 41750b163c..0000000000 --- a/bin/create-missing-schedules +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -php /usr/src/code/app/cli.php create-missing-schedules $@ \ No newline at end of file diff --git a/bin/patch-create-missing-schedules b/bin/patch-create-missing-schedules new file mode 100644 index 0000000000..e38d3e9a6f --- /dev/null +++ b/bin/patch-create-missing-schedules @@ -0,0 +1,3 @@ +#!/bin/sh + +php /usr/src/code/app/cli.php patch-create-missing-schedules $@ \ No newline at end of file diff --git a/src/Appwrite/Platform/Services/Tasks.php b/src/Appwrite/Platform/Services/Tasks.php index e6919f2cc7..2e15cd015c 100644 --- a/src/Appwrite/Platform/Services/Tasks.php +++ b/src/Appwrite/Platform/Services/Tasks.php @@ -8,7 +8,7 @@ use Appwrite\Platform\Tasks\Install; use Appwrite\Platform\Tasks\Maintenance; use Appwrite\Platform\Tasks\Migrate; use Appwrite\Platform\Tasks\Schedule; -use Appwrite\Platform\Tasks\CreateMissingSchedules; +use Appwrite\Platform\Tasks\PatchCreateMissingSchedules; use Appwrite\Platform\Tasks\SDKs; use Appwrite\Platform\Tasks\Specs; use Appwrite\Platform\Tasks\SSL; @@ -30,7 +30,7 @@ class Tasks extends Service ->addAction(Doctor::getName(), new Doctor()) ->addAction(Install::getName(), new Install()) ->addAction(Maintenance::getName(), new Maintenance()) - ->addAction(CreateMissingSchedules::getName(), new CreateMissingSchedules()) + ->addAction(PatchCreateMissingSchedules::getName(), new PatchCreateMissingSchedules()) ->addAction(Schedule::getName(), new Schedule()) ->addAction(Migrate::getName(), new Migrate()) ->addAction(SDKs::getName(), new SDKs()) diff --git a/src/Appwrite/Platform/Tasks/CreateMissingSchedules.php b/src/Appwrite/Platform/Tasks/PatchCreateMissingSchedules.php similarity index 93% rename from src/Appwrite/Platform/Tasks/CreateMissingSchedules.php rename to src/Appwrite/Platform/Tasks/PatchCreateMissingSchedules.php index 75e1d5b637..32b9886347 100644 --- a/src/Appwrite/Platform/Tasks/CreateMissingSchedules.php +++ b/src/Appwrite/Platform/Tasks/PatchCreateMissingSchedules.php @@ -11,11 +11,11 @@ use Utopia\Database\Database; use Utopia\Database\ID; use Utopia\Database\Validator\Authorization; -class CreateMissingSchedules extends Action +class PatchCreateMissingSchedules extends Action { public static function getName(): string { - return 'create-missing-schedules'; + return 'patch-create-missing-schedules'; } public function __construct() @@ -35,8 +35,8 @@ class CreateMissingSchedules extends Action Authorization::disable(); Authorization::setDefaultStatus(false); - Console::title('CreateMissingSchedules V1'); - Console::success(APP_NAME . ' CreateMissingSchedules v1 has started'); + Console::title('PatchCreateMissingSchedules V1'); + Console::success(APP_NAME . ' PatchCreateMissingSchedules v1 has started'); $limit = 100; $projectCursor = null; From 3af214172cc8417289052494949baa671ee7cf47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 14 Dec 2022 11:10:16 +0100 Subject: [PATCH 73/76] Rollback unwanted changes --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index fee6c6653d..51e6cc3705 100644 --- a/.env +++ b/.env @@ -64,7 +64,7 @@ _APP_MAINTENANCE_RETENTION_CACHE=2592000 _APP_MAINTENANCE_RETENTION_EXECUTION=1209600 _APP_MAINTENANCE_RETENTION_ABUSE=86400 _APP_MAINTENANCE_RETENTION_AUDIT=1209600 -_APP_MAINTENANCE_RETENTION_SCHEDULES=600 +_APP_MAINTENANCE_RETENTION_SCHEDULES=86400 _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 _APP_USAGE_STATS=enabled _APP_USAGE_AGGREGATION_INTERVAL=30 From 072d896bb94249461958e9b9cd786aaf8edaa824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 14 Dec 2022 12:37:01 +0100 Subject: [PATCH 74/76] Add missing chmod for patch task --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 7aa447d279..54aa327769 100755 --- a/Dockerfile +++ b/Dockerfile @@ -303,6 +303,7 @@ RUN mkdir -p /storage/uploads && \ # Executables RUN chmod +x /usr/local/bin/doctor && \ + chmod +x /usr/local/bin/patch-create-missing-schedules && \ chmod +x /usr/local/bin/maintenance && \ chmod +x /usr/local/bin/volume-sync && \ chmod +x /usr/local/bin/usage && \ From 4ee8fd5629e01547e042cc449cde130860bbd30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 16 Dec 2022 10:39:53 +0100 Subject: [PATCH 75/76] Add cache clean --- src/Appwrite/Migration/Version/V17.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php index b04aa2a7c3..66a02662d1 100644 --- a/src/Appwrite/Migration/Version/V17.php +++ b/src/Appwrite/Migration/Version/V17.php @@ -52,6 +52,7 @@ class V17 extends Migration * Update 'mimeType' attribute size (127->255) */ $this->projectDB->updateAttribute($id, 'mimeType', Database::VAR_STRING, 255, true, false); + $this->projectDB->deleteCachedCollection($id); } catch (\Throwable $th) { Console::warning("'mimeType' from {$id}: {$th->getMessage()}"); } From ff7393985533a0cc5d7934ddf7e9ab320485bcfb Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 18 Dec 2022 15:23:18 +0530 Subject: [PATCH 76/76] feat: update console and build args --- app/console | 2 +- docker-compose.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/console b/app/console index c1ac63889c..43891a526e 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit c1ac63889c0a97b280599355e526669bb207880a +Subproject commit 43891a526e061454617cbb13def3c4901d99a7f1 diff --git a/docker-compose.yml b/docker-compose.yml index 7620039b63..feac2c89d0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,6 +53,7 @@ services: DEBUG: false TESTING: true VERSION: dev + VITE_CONSOLE_MODE: self-hosted ports: - 9501:80 networks: