Merge pull request #3085 from appwrite/feat-release-dart-flutter-sdk

Upgrade SDK-Generator
This commit is contained in:
Eldad A. Fux 2022-04-12 08:40:42 +03:00 committed by GitHub
commit 5760334273
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
192 changed files with 907 additions and 2022 deletions

View file

@ -63,7 +63,7 @@ return [
[
'key' => 'flutter',
'name' => 'Flutter',
'version' => '4.0.1',
'version' => '4.0.2',
'url' => 'https://github.com/appwrite/sdk-for-flutter',
'package' => 'https://pub.dev/packages/appwrite',
'enabled' => true,
@ -81,7 +81,7 @@ return [
[
'key' => 'apple',
'name' => 'Apple',
'version' => '0.3.0',
'version' => '0.3.1',
'url' => 'https://github.com/appwrite/sdk-for-apple',
'package' => 'https://github.com/appwrite/sdk-for-apple',
'enabled' => true,
@ -116,7 +116,7 @@ return [
[
'key' => 'android',
'name' => 'Android',
'version' => '0.4.0',
'version' => '0.4.1',
'url' => 'https://github.com/appwrite/sdk-for-android',
'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-android',
'enabled' => true,
@ -352,7 +352,7 @@ return [
[
'key' => 'dart',
'name' => 'Dart',
'version' => '4.0.1',
'version' => '4.0.2',
'url' => 'https://github.com/appwrite/sdk-for-dart',
'package' => 'https://pub.dev/packages/dart_appwrite',
'enabled' => true,
@ -392,7 +392,7 @@ return [
[
'key' => 'swift',
'name' => 'Swift',
'version' => '0.3.0',
'version' => '0.3.1',
'url' => 'https://github.com/appwrite/sdk-for-swift',
'package' => 'https://github.com/appwrite/sdk-for-swift',
'enabled' => true,

View file

@ -71,7 +71,7 @@
}
],
"require-dev": {
"appwrite/sdk-generator": "0.18.1",
"appwrite/sdk-generator": "0.18.2",
"phpunit/phpunit": "9.5.10",
"swoole/ide-helper": "4.8.5",
"textalk/websocket": "1.5.5",

15
composer.lock generated
View file

@ -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": "c23ee95a9a573b123ec587734023132e",
"content-hash": "bca03b1d0b7dd312bc174e0a2973b015",
"packages": [
{
"name": "adhocore/jwt",
@ -3075,16 +3075,16 @@
},
{
"name": "appwrite/sdk-generator",
"version": "0.18.1",
"version": "0.18.2",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "1d5293dd65e014f2067f2bfc9c0c45e5b0de56aa"
"reference": "9381507c1526da1c099eb2297e68374dec4e3793"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/1d5293dd65e014f2067f2bfc9c0c45e5b0de56aa",
"reference": "1d5293dd65e014f2067f2bfc9c0c45e5b0de56aa",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/9381507c1526da1c099eb2297e68374dec4e3793",
"reference": "9381507c1526da1c099eb2297e68374dec4e3793",
"shasum": ""
},
"require": {
@ -3096,6 +3096,7 @@
"twig/twig": "^3.3"
},
"require-dev": {
"brianium/paratest": "^6.4",
"phpunit/phpunit": "^9.5.13"
},
"type": "library",
@ -3118,9 +3119,9 @@
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"support": {
"issues": "https://github.com/appwrite/sdk-generator/issues",
"source": "https://github.com/appwrite/sdk-generator/tree/0.18.1"
"source": "https://github.com/appwrite/sdk-generator/tree/0.18.2"
},
"time": "2022-03-03T09:45:38+00:00"
"time": "2022-04-10T09:03:18+00:00"
},
{
"name": "composer/pcre",

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
account.createAnonymousSession() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
let session = try await account.createAnonymousSession()
print(String(describing: session)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
account.createJWT() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let jwt):
print(String(describing: jwt)
}
}
let jwt = try await account.createJWT()
print(String(describing: jwt)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.createMagicURLSession(
let token = try await account.createMagicURLSession(
userId: "[USER_ID]",
email: "email@example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
account.createOAuth2Session(
let success = try await account.createOAuth2Session(
provider: "amazon"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let success):
print(String(describing: success)
}
}
)
print(String(describing: success)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.createRecovery(
let token = try await account.createRecovery(
email: "email@example.com",
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.createSession(
let session = try await account.createSession(
email: "email@example.com",
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
account.createVerification(
let token = try await account.createVerification(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
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)
account.create(
let user = try await account.create(
userId: "[USER_ID]",
email: "email@example.com",
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
account.deleteSession(
let result = try await account.deleteSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
account.deleteSessions() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
let result = try await account.deleteSessions()
print(String(describing: result)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
account.delete() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
let result = try await account.delete()
print(String(describing: result)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
account.getLogs() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let logList):
print(String(describing: logList)
}
}
let logList = try await account.getLogs()
print(String(describing: logList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
account.getPrefs() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let preferences):
print(String(describing: preferences)
}
}
let preferences = try await account.getPrefs()
print(String(describing: preferences)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
account.getSession(
let session = try await account.getSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
account.getSessions() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let sessionList):
print(String(describing: sessionList)
}
}
let sessionList = try await account.getSessions()
print(String(describing: sessionList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
account.get() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
let user = try await account.get()
print(String(describing: user)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.updateEmail(
let user = try await account.updateEmail(
email: "email@example.com",
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.updateMagicURLSession(
let session = try await account.updateMagicURLSession(
userId: "[USER_ID]",
secret: "[SECRET]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
account.updateName(
let user = try await account.updateName(
name: "[NAME]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
account.updatePassword(
let user = try await account.updatePassword(
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
account.updatePrefs(
let user = try await account.updatePrefs(
prefs:
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
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)
account.updateRecovery(
let token = try await account.updateRecovery(
userId: "[USER_ID]",
secret: "[SECRET]",
password: "password",
passwordAgain: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
account.updateSession(
let session = try await account.updateSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.updateVerification(
let token = try await account.updateVerification(
userId: "[USER_ID]",
secret: "[SECRET]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
avatars.getBrowser(
let byteBuffer = try await avatars.getBrowser(
code: "aa"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
avatars.getCreditCard(
let byteBuffer = try await avatars.getCreditCard(
code: "amex"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
avatars.getFavicon(
let byteBuffer = try await avatars.getFavicon(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
avatars.getFlag(
let byteBuffer = try await avatars.getFlag(
code: "af"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
avatars.getImage(
let byteBuffer = try await avatars.getImage(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
avatars.getInitials() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
let byteBuffer = try await avatars.getInitials()
print(String(describing: byteBuffer)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
avatars.getQR(
let byteBuffer = try await avatars.getQR(
text: "[TEXT]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.createDocument(
let document = try await database.createDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]",
data:
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let document):
print(String(describing: document)
}
}
)
print(String(describing: document)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.deleteDocument(
let result = try await database.deleteDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.getDocument(
let document = try await database.getDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let document):
print(String(describing: document)
}
}
)
print(String(describing: document)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.listDocuments(
let documentList = try await database.listDocuments(
collectionId: "[COLLECTION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let documentList):
print(String(describing: documentList)
}
}
)
print(String(describing: documentList)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
func main() async throws {
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
let database = Database(client)
database.updateDocument(
let document = try await database.updateDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]",
data:
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let document):
print(String(describing: document)
}
}
)
print(String(describing: document)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
functions.createExecution(
let execution = try await functions.createExecution(
functionId: "[FUNCTION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let execution):
print(String(describing: execution)
}
}
)
print(String(describing: execution)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
functions.getExecution(
let execution = try await functions.getExecution(
functionId: "[FUNCTION_ID]",
executionId: "[EXECUTION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let execution):
print(String(describing: execution)
}
}
)
print(String(describing: execution)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
functions.listExecutions(
let executionList = try await functions.listExecutions(
functionId: "[FUNCTION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let executionList):
print(String(describing: executionList)
}
}
)
print(String(describing: executionList)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
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)
functions.retryBuild(
let result = try await functions.retryBuild(
functionId: "[FUNCTION_ID]",
deploymentId: "[DEPLOYMENT_ID]",
buildId: "[BUILD_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
locale.getContinents() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let continentList):
print(String(describing: continentList)
}
}
let continentList = try await locale.getContinents()
print(String(describing: continentList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
locale.getCountriesEU() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let countryList):
print(String(describing: countryList)
}
}
let countryList = try await locale.getCountriesEU()
print(String(describing: countryList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
locale.getCountriesPhones() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let phoneList):
print(String(describing: phoneList)
}
}
let phoneList = try await locale.getCountriesPhones()
print(String(describing: phoneList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
locale.getCountries() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let countryList):
print(String(describing: countryList)
}
}
let countryList = try await locale.getCountries()
print(String(describing: countryList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
locale.getCurrencies() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let currencyList):
print(String(describing: currencyList)
}
}
let currencyList = try await locale.getCurrencies()
print(String(describing: currencyList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
locale.getLanguages() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let languageList):
print(String(describing: languageList)
}
}
let languageList = try await locale.getLanguages()
print(String(describing: languageList)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
locale.get() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let locale):
print(String(describing: locale)
}
}
let locale = try await locale.get()
print(String(describing: locale)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
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)
storage.createFile(
let file = try await storage.createFile(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]",
file: File(name: "image.jpg", buffer: yourByteBuffer)
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let file):
print(String(describing: file)
}
}
)
print(String(describing: file)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
storage.deleteFile(
let result = try await storage.deleteFile(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
storage.getFileDownload(
let byteBuffer = try await storage.getFileDownload(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
storage.getFilePreview(
let byteBuffer = try await storage.getFilePreview(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
storage.getFileView(
let byteBuffer = try await storage.getFileView(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
storage.getFile(
let file = try await storage.getFile(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let file):
print(String(describing: file)
}
}
)
print(String(describing: file)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
storage.listFiles(
let fileList = try await storage.listFiles(
bucketId: "[BUCKET_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let fileList):
print(String(describing: fileList)
}
}
)
print(String(describing: fileList)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
storage.updateFile(
let file = try await storage.updateFile(
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let file):
print(String(describing: file)
}
}
)
print(String(describing: file)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
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)
teams.createMembership(
let membership = try await teams.createMembership(
teamId: "[TEAM_ID]",
email: "email@example.com",
roles: [],
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membership):
print(String(describing: membership)
}
}
)
print(String(describing: membership)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
teams.create(
let team = try await teams.create(
teamId: "[TEAM_ID]",
name: "[NAME]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let team):
print(String(describing: team)
}
}
)
print(String(describing: team)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
teams.deleteMembership(
let result = try await teams.deleteMembership(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
teams.delete(
let result = try await teams.delete(
teamId: "[TEAM_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
teams.getMembership(
let membershipList = try await teams.getMembership(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membershipList):
print(String(describing: membershipList)
}
}
)
print(String(describing: membershipList)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
teams.getMemberships(
let membershipList = try await teams.getMemberships(
teamId: "[TEAM_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membershipList):
print(String(describing: membershipList)
}
}
)
print(String(describing: membershipList)
}

View file

@ -1,19 +1,13 @@
import Appwrite
func main() {
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)
teams.get(
let team = try await teams.get(
teamId: "[TEAM_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let team):
print(String(describing: team)
}
}
)
print(String(describing: team)
}

View file

@ -1,17 +1,11 @@
import Appwrite
func main() {
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)
teams.list() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let teamList):
print(String(describing: teamList)
}
}
let teamList = try await teams.list()
print(String(describing: teamList)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
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)
teams.updateMembershipRoles(
let membership = try await teams.updateMembershipRoles(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]",
roles: []
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membership):
print(String(describing: membership)
}
}
)
print(String(describing: membership)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
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)
teams.updateMembershipStatus(
let membership = try await teams.updateMembershipStatus(
teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]",
userId: "[USER_ID]",
secret: "[SECRET]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let membership):
print(String(describing: membership)
}
}
)
print(String(describing: membership)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
teams.update(
let team = try await teams.update(
teamId: "[TEAM_ID]",
name: "[NAME]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let team):
print(String(describing: team)
}
}
)
print(String(describing: team)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
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)
account.createRecovery(
let token = try await account.createRecovery(
email: "email@example.com",
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.createVerification(
let token = try await account.createVerification(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.deleteSession(
let result = try await account.deleteSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
)
print(String(describing: result)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
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)
account.deleteSessions() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
let result = try await account.deleteSessions()
print(String(describing: result)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
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)
account.delete() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let ):
print(String(describing: )
}
}
let result = try await account.delete()
print(String(describing: result)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
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)
account.getLogs() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let logList):
print(String(describing: logList)
}
}
let logList = try await account.getLogs()
print(String(describing: logList)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
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)
account.getPrefs() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let preferences):
print(String(describing: preferences)
}
}
let preferences = try await account.getPrefs()
print(String(describing: preferences)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.getSession(
let session = try await account.getSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
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)
account.getSessions() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let sessionList):
print(String(describing: sessionList)
}
}
let sessionList = try await account.getSessions()
print(String(describing: sessionList)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
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)
account.get() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
let user = try await account.get()
print(String(describing: user)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
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)
account.updateEmail(
let user = try await account.updateEmail(
email: "email@example.com",
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.updateName(
let user = try await account.updateName(
name: "[NAME]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.updatePassword(
let user = try await account.updatePassword(
password: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.updatePrefs(
let user = try await account.updatePrefs(
prefs:
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let user):
print(String(describing: user)
}
}
)
print(String(describing: user)
}

View file

@ -1,23 +1,17 @@
import Appwrite
func main() {
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)
account.updateRecovery(
let token = try await account.updateRecovery(
userId: "[USER_ID]",
secret: "[SECRET]",
password: "password",
passwordAgain: "password"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
account.updateSession(
let session = try await account.updateSession(
sessionId: "[SESSION_ID]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let session):
print(String(describing: session)
}
}
)
print(String(describing: session)
}

View file

@ -1,21 +1,15 @@
import Appwrite
func main() {
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)
account.updateVerification(
let token = try await account.updateVerification(
userId: "[USER_ID]",
secret: "[SECRET]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let token):
print(String(describing: token)
}
}
)
print(String(describing: token)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
avatars.getBrowser(
let byteBuffer = try await avatars.getBrowser(
code: "aa"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
avatars.getCreditCard(
let byteBuffer = try await avatars.getCreditCard(
code: "amex"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
avatars.getFavicon(
let byteBuffer = try await avatars.getFavicon(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
avatars.getFlag(
let byteBuffer = try await avatars.getFlag(
code: "af"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
avatars.getImage(
let byteBuffer = try await avatars.getImage(
url: "https://example.com"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,18 +1,12 @@
import Appwrite
func main() {
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)
avatars.getInitials() { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
let byteBuffer = try await avatars.getInitials()
print(String(describing: byteBuffer)
}

View file

@ -1,20 +1,14 @@
import Appwrite
func main() {
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)
avatars.getQR(
let byteBuffer = try await avatars.getQR(
text: "[TEXT]"
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let byteBuffer):
print(String(describing: byteBuffer)
}
}
)
print(String(describing: byteBuffer)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
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 database = Database(client)
database.createBooleanAttribute(
let attributeBoolean = try await database.createBooleanAttribute(
collectionId: "[COLLECTION_ID]",
key: "",
required: xfalse
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let attributeBoolean):
print(String(describing: attributeBoolean)
}
}
)
print(String(describing: attributeBoolean)
}

View file

@ -1,24 +1,18 @@
import Appwrite
func main() {
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 database = Database(client)
database.createCollection(
let collection = try await database.createCollection(
collectionId: "[COLLECTION_ID]",
name: "[NAME]",
permission: "document",
read: ["role:all"],
write: ["role:all"]
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let collection):
print(String(describing: collection)
}
}
)
print(String(describing: collection)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
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 database = Database(client)
database.createDocument(
let document = try await database.createDocument(
collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]",
data:
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let document):
print(String(describing: document)
}
}
)
print(String(describing: document)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
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 database = Database(client)
database.createEmailAttribute(
let attributeEmail = try await database.createEmailAttribute(
collectionId: "[COLLECTION_ID]",
key: "",
required: xfalse
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let attributeEmail):
print(String(describing: attributeEmail)
}
}
)
print(String(describing: attributeEmail)
}

View file

@ -1,23 +1,17 @@
import Appwrite
func main() {
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 database = Database(client)
database.createEnumAttribute(
let attributeEnum = try await database.createEnumAttribute(
collectionId: "[COLLECTION_ID]",
key: "",
elements: [],
required: xfalse
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let attributeEnum):
print(String(describing: attributeEnum)
}
}
)
print(String(describing: attributeEnum)
}

View file

@ -1,22 +1,16 @@
import Appwrite
func main() {
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 database = Database(client)
database.createFloatAttribute(
let attributeFloat = try await database.createFloatAttribute(
collectionId: "[COLLECTION_ID]",
key: "",
required: xfalse
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let attributeFloat):
print(String(describing: attributeFloat)
}
}
)
print(String(describing: attributeFloat)
}

View file

@ -1,23 +1,17 @@
import Appwrite
func main() {
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 database = Database(client)
database.createIndex(
let index = try await database.createIndex(
collectionId: "[COLLECTION_ID]",
key: "",
type: "key",
attributes: []
) { result in
switch result {
case .failure(let error):
print(error.message)
case .success(let index):
print(String(describing: index)
}
}
)
print(String(describing: index)
}

Some files were not shown because too many files have changed in this diff Show more