Merge pull request #1345 from appwrite/feat-update-specs
feat: update specs and regenerate docs
This commit is contained in:
commit
56a272561c
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -5,4 +5,5 @@
|
||||||
/.idea/
|
/.idea/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.php_cs.cache
|
.php_cs.cache
|
||||||
debug/
|
debug/
|
||||||
|
app/sdks
|
|
@ -15,7 +15,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'web',
|
'key' => 'web',
|
||||||
'name' => 'Web',
|
'name' => 'Web',
|
||||||
'version' => '3.1.0',
|
'version' => '3.2.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-web',
|
'url' => 'https://github.com/appwrite/sdk-for-web',
|
||||||
'package' => 'https://www.npmjs.com/package/appwrite',
|
'package' => 'https://www.npmjs.com/package/appwrite',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -62,7 +62,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'flutter',
|
'key' => 'flutter',
|
||||||
'name' => 'Flutter',
|
'name' => 'Flutter',
|
||||||
'version' => '0.6.4',
|
'version' => '0.7.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-flutter',
|
'url' => 'https://github.com/appwrite/sdk-for-flutter',
|
||||||
'package' => 'https://pub.dev/packages/appwrite',
|
'package' => 'https://pub.dev/packages/appwrite',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -152,7 +152,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'web',
|
'key' => 'web',
|
||||||
'name' => 'Console',
|
'name' => 'Console',
|
||||||
'version' => '2.0.0',
|
'version' => '2.1.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-console',
|
'url' => 'https://github.com/appwrite/sdk-for-console',
|
||||||
'package' => '',
|
'package' => '',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -179,7 +179,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'nodejs',
|
'key' => 'nodejs',
|
||||||
'name' => 'Node.js',
|
'name' => 'Node.js',
|
||||||
'version' => '2.3.0',
|
'version' => '2.4.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-node',
|
'url' => 'https://github.com/appwrite/sdk-for-node',
|
||||||
'package' => 'https://www.npmjs.com/package/node-appwrite',
|
'package' => 'https://www.npmjs.com/package/node-appwrite',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -196,7 +196,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'deno',
|
'key' => 'deno',
|
||||||
'name' => 'Deno',
|
'name' => 'Deno',
|
||||||
'version' => '0.2.2',
|
'version' => '0.3.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-deno',
|
'url' => 'https://github.com/appwrite/sdk-for-deno',
|
||||||
'package' => 'https://deno.land/x/appwrite',
|
'package' => 'https://deno.land/x/appwrite',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -213,7 +213,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'php',
|
'key' => 'php',
|
||||||
'name' => 'PHP',
|
'name' => 'PHP',
|
||||||
'version' => '2.1.2',
|
'version' => '2.2.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-php',
|
'url' => 'https://github.com/appwrite/sdk-for-php',
|
||||||
'package' => 'https://packagist.org/packages/appwrite/appwrite',
|
'package' => 'https://packagist.org/packages/appwrite/appwrite',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -230,7 +230,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'python',
|
'key' => 'python',
|
||||||
'name' => 'Python',
|
'name' => 'Python',
|
||||||
'version' => '0.3.0',
|
'version' => '0.4.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-python',
|
'url' => 'https://github.com/appwrite/sdk-for-python',
|
||||||
'package' => 'https://pypi.org/project/appwrite/',
|
'package' => 'https://pypi.org/project/appwrite/',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -247,7 +247,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'ruby',
|
'key' => 'ruby',
|
||||||
'name' => 'Ruby',
|
'name' => 'Ruby',
|
||||||
'version' => '2.2.0',
|
'version' => '2.3.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-ruby',
|
'url' => 'https://github.com/appwrite/sdk-for-ruby',
|
||||||
'package' => 'https://rubygems.org/gems/appwrite',
|
'package' => 'https://rubygems.org/gems/appwrite',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -264,7 +264,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'go',
|
'key' => 'go',
|
||||||
'name' => 'Go',
|
'name' => 'Go',
|
||||||
'version' => '0.0.7',
|
'version' => '0.1.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-go',
|
'url' => 'https://github.com/appwrite/sdk-for-go',
|
||||||
'package' => '',
|
'package' => '',
|
||||||
'enabled' => false,
|
'enabled' => false,
|
||||||
|
@ -315,7 +315,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'dart',
|
'key' => 'dart',
|
||||||
'name' => 'Dart',
|
'name' => 'Dart',
|
||||||
'version' => '0.6.3',
|
'version' => '0.7.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-dart',
|
'url' => 'https://github.com/appwrite/sdk-for-dart',
|
||||||
'package' => 'https://pub.dev/packages/dart_appwrite',
|
'package' => 'https://pub.dev/packages/dart_appwrite',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
@ -332,7 +332,7 @@ return [
|
||||||
[
|
[
|
||||||
'key' => 'cli',
|
'key' => 'cli',
|
||||||
'name' => 'Command Line',
|
'name' => 'Command Line',
|
||||||
'version' => '0.10.0',
|
'version' => '0.11.0',
|
||||||
'url' => 'https://github.com/appwrite/sdk-for-cli',
|
'url' => 'https://github.com/appwrite/sdk-for-cli',
|
||||||
'package' => 'https://github.com/appwrite/sdk-for-cli',
|
'package' => 'https://github.com/appwrite/sdk-for-cli',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -225,8 +225,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
\exec('mkdir -p '.$resultExamples.' && cp -r '.$result.'/docs/examples '.$resultExamples);
|
\exec('mkdir -p '.$resultExamples.' && cp -r '.$result.'/docs/examples '.$resultExamples);
|
||||||
Console::success("Copied code examples for {$language['name']} SDK to: {$resultExamples}");
|
Console::success("Copied code examples for {$language['name']} SDK to: {$resultExamples}");
|
||||||
|
|
||||||
\exec('rm -rf '.$result);
|
|
||||||
Console::success("Removed source code directory '{$result}' for {$language['name']} SDK");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
"ext-sockets": "*",
|
"ext-sockets": "*",
|
||||||
|
|
||||||
"appwrite/php-clamav": "1.1.*",
|
"appwrite/php-clamav": "1.1.*",
|
||||||
"appwrite/php-runtimes": "0.3.*",
|
"appwrite/php-runtimes": "0.4.*",
|
||||||
|
|
||||||
"utopia-php/framework": "0.14.*",
|
"utopia-php/framework": "0.14.*",
|
||||||
"utopia-php/abuse": "0.5.*",
|
"utopia-php/abuse": "0.5.*",
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
"slickdeals/statsd": "3.1.0"
|
"slickdeals/statsd": "3.1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"appwrite/sdk-generator": "0.11.0",
|
"appwrite/sdk-generator": "0.11.1",
|
||||||
"swoole/ide-helper": "4.6.7",
|
"swoole/ide-helper": "4.6.7",
|
||||||
"phpunit/phpunit": "9.5.6",
|
"phpunit/phpunit": "9.5.6",
|
||||||
"vimeo/psalm": "4.7.2"
|
"vimeo/psalm": "4.7.2"
|
||||||
|
|
28
composer.lock
generated
28
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "b30bdf7eb1369ae7f2f742e2f30055ae",
|
"content-hash": "65ff5003b9122286423aa030cb6983ea",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "adhocore/jwt",
|
"name": "adhocore/jwt",
|
||||||
|
@ -115,16 +115,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "appwrite/php-runtimes",
|
"name": "appwrite/php-runtimes",
|
||||||
"version": "0.3.0",
|
"version": "0.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/appwrite/php-runtimes.git",
|
"url": "https://github.com/appwrite/php-runtimes.git",
|
||||||
"reference": "39be003cdff22c8447de151921001eb5d3bf2319"
|
"reference": "cc7090a67d8824c779190b38873f0f8154f906b2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/appwrite/php-runtimes/zipball/39be003cdff22c8447de151921001eb5d3bf2319",
|
"url": "https://api.github.com/repos/appwrite/php-runtimes/zipball/cc7090a67d8824c779190b38873f0f8154f906b2",
|
||||||
"reference": "39be003cdff22c8447de151921001eb5d3bf2319",
|
"reference": "cc7090a67d8824c779190b38873f0f8154f906b2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"BSD-3"
|
"BSD-3-Clause"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@ -164,9 +164,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/appwrite/php-runtimes/issues",
|
"issues": "https://github.com/appwrite/php-runtimes/issues",
|
||||||
"source": "https://github.com/appwrite/php-runtimes/tree/0.3.0"
|
"source": "https://github.com/appwrite/php-runtimes/tree/0.4.0"
|
||||||
},
|
},
|
||||||
"time": "2021-06-15T07:52:43+00:00"
|
"time": "2021-06-23T07:17:12+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "chillerlan/php-qrcode",
|
"name": "chillerlan/php-qrcode",
|
||||||
|
@ -2403,16 +2403,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "appwrite/sdk-generator",
|
"name": "appwrite/sdk-generator",
|
||||||
"version": "0.11.0",
|
"version": "0.11.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/appwrite/sdk-generator.git",
|
"url": "https://github.com/appwrite/sdk-generator.git",
|
||||||
"reference": "96c41c44f930a4d40184cd0f3c7dca76d2cca7e1"
|
"reference": "9809c31f27037d088fb832cdec0e8fbc93d1d388"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/96c41c44f930a4d40184cd0f3c7dca76d2cca7e1",
|
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/9809c31f27037d088fb832cdec0e8fbc93d1d388",
|
||||||
"reference": "96c41c44f930a4d40184cd0f3c7dca76d2cca7e1",
|
"reference": "9809c31f27037d088fb832cdec0e8fbc93d1d388",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -2446,9 +2446,9 @@
|
||||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/appwrite/sdk-generator/issues",
|
"issues": "https://github.com/appwrite/sdk-generator/issues",
|
||||||
"source": "https://github.com/appwrite/sdk-generator/tree/0.11.0"
|
"source": "https://github.com/appwrite/sdk-generator/tree/0.11.1"
|
||||||
},
|
},
|
||||||
"time": "2021-07-01T13:51:23+00:00"
|
"time": "2021-07-02T10:15:53+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/package-versions-deprecated",
|
"name": "composer/package-versions-deprecated",
|
||||||
|
|
|
@ -5,7 +5,7 @@ sdk
|
||||||
.setProject('5df5acd0d48c2') // Your project ID
|
.setProject('5df5acd0d48c2') // Your project ID
|
||||||
;
|
;
|
||||||
|
|
||||||
let promise = sdk.functions.create('[NAME]', [], 'java-11');
|
let promise = sdk.functions.create('[NAME]', [], 'java-11.0');
|
||||||
|
|
||||||
promise.then(function (response) {
|
promise.then(function (response) {
|
||||||
console.log(response); // Success
|
console.log(response); // Success
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
appwrite functions create --name="[NAME]" --execute="" --runtime="java-11" --vars="{}" --events="" --schedule="" --timeout="1"
|
appwrite functions create --name="[NAME]" --execute="" --runtime="java-11.0" --vars="{}" --events="" --schedule="" --timeout="1"
|
|
@ -13,7 +13,7 @@ void main() { // Init SDK
|
||||||
Future result = functions.create(
|
Future result = functions.create(
|
||||||
name: '[NAME]',
|
name: '[NAME]',
|
||||||
execute: [],
|
execute: [],
|
||||||
runtime: 'java-11',
|
runtime: 'java-11.0',
|
||||||
);
|
);
|
||||||
|
|
||||||
result
|
result
|
||||||
|
|
|
@ -12,7 +12,7 @@ client
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
let promise = functions.create('[NAME]', [], 'java-11');
|
let promise = functions.create('[NAME]', [], 'java-11.0');
|
||||||
|
|
||||||
promise.then(function (response) {
|
promise.then(function (response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
|
|
@ -10,4 +10,4 @@ client
|
||||||
|
|
||||||
Functions functions = new Functions(client);
|
Functions functions = new Functions(client);
|
||||||
|
|
||||||
HttpResponseMessage result = await functions.Create("[NAME]", [List<object>], "java-11");
|
HttpResponseMessage result = await functions.Create("[NAME]", [List<object>], "java-11.0");
|
||||||
|
|
|
@ -11,7 +11,7 @@ suspend fun main() {
|
||||||
val response = functions.create(
|
val response = functions.create(
|
||||||
name = "[NAME]",
|
name = "[NAME]",
|
||||||
execute = listOf(),
|
execute = listOf(),
|
||||||
runtime = "java-11",
|
runtime = "java-11.0",
|
||||||
)
|
)
|
||||||
val json = response.body?.string()
|
val json = response.body?.string()
|
||||||
}
|
}
|
|
@ -11,7 +11,7 @@ client
|
||||||
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
||||||
;
|
;
|
||||||
|
|
||||||
let promise = functions.create('[NAME]', [], 'java-11');
|
let promise = functions.create('[NAME]', [], 'java-11.0');
|
||||||
|
|
||||||
promise.then(function (response) {
|
promise.then(function (response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
|
|
@ -13,4 +13,4 @@ $client
|
||||||
|
|
||||||
$functions = new Functions($client);
|
$functions = new Functions($client);
|
||||||
|
|
||||||
$result = $functions->create('[NAME]', [], 'java-11');
|
$result = $functions->create('[NAME]', [], 'java-11.0');
|
|
@ -11,4 +11,4 @@ client = Client()
|
||||||
|
|
||||||
functions = Functions(client)
|
functions = Functions(client)
|
||||||
|
|
||||||
result = functions.create('[NAME]', [], 'java-11')
|
result = functions.create('[NAME]', [], 'java-11.0')
|
||||||
|
|
|
@ -10,6 +10,6 @@ client
|
||||||
|
|
||||||
functions = Appwrite::Functions.new(client);
|
functions = Appwrite::Functions.new(client);
|
||||||
|
|
||||||
response = functions.create(name: '[NAME]', execute: [], runtime: 'java-11');
|
response = functions.create(name: '[NAME]', execute: [], runtime: 'java-11.0');
|
||||||
|
|
||||||
puts response
|
puts response
|
|
@ -40,7 +40,7 @@ try {
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
|
@ -68,7 +68,7 @@ try {
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
|
@ -45,7 +45,7 @@ try {
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
|
@ -122,7 +122,7 @@ try {
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
85
docs/sdks/kotlin/GETTING_STARTED.md
Normal file
85
docs/sdks/kotlin/GETTING_STARTED.md
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Init your SDK
|
||||||
|
|
||||||
|
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key project API keys section.
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
import io.appwrite.Client
|
||||||
|
import io.appwrite.services.Account
|
||||||
|
|
||||||
|
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
|
||||||
|
.setSelfSigned(true) // Use only on dev mode with a self-signed SSL cert
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Make Your First Request
|
||||||
|
|
||||||
|
Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
val users = Users(client)
|
||||||
|
val response = users.create(
|
||||||
|
email = "email@example.com",
|
||||||
|
password = "password",
|
||||||
|
)
|
||||||
|
val json = response.body?.string()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Full Example
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
import io.appwrite.Client
|
||||||
|
import io.appwrite.services.Users
|
||||||
|
|
||||||
|
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
|
||||||
|
.setSelfSigned(true) // Use only on dev mode with a self-signed SSL cert
|
||||||
|
|
||||||
|
val users = Users(client)
|
||||||
|
val response = users.create(
|
||||||
|
email = "email@example.com",
|
||||||
|
password = "password",
|
||||||
|
)
|
||||||
|
val json = response.body?.string()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
|
||||||
|
The Appwrite Kotlin SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
import io.appwrite.Client
|
||||||
|
import io.appwrite.services.Users
|
||||||
|
|
||||||
|
suspend fun main() {
|
||||||
|
val users = Users(client)
|
||||||
|
try {
|
||||||
|
val response = users.create(
|
||||||
|
email = "email@example.com",
|
||||||
|
password = "password",
|
||||||
|
)
|
||||||
|
var jsonString = response.body?.string() ?: ""
|
||||||
|
|
||||||
|
} catch (e: AppwriteException) {
|
||||||
|
println(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Learn more
|
||||||
|
|
||||||
|
You can use following resources to learn more and get help
|
||||||
|
|
||||||
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
- 🚂 [Appwrite Kotlin Playground](https://github.com/appwrite/playground-for-kotlin)
|
|
@ -68,7 +68,7 @@ try {
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
|
@ -56,7 +56,7 @@ try {
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
|
@ -57,7 +57,7 @@ except AppwriteException as e:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
|
@ -57,7 +57,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
|
@ -52,7 +52,7 @@ sdk.account.create('me@example.com', 'password', 'Jane Doe')
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use following resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
|
||||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
|
Loading…
Reference in a new issue