1
0
Fork 0
mirror of synced 2024-06-28 19:20:25 +12:00

Update Apple + Swift examples

This commit is contained in:
Jake Barnby 2021-10-14 23:07:14 +13:00
parent 90904ab676
commit e5ba262742
162 changed files with 163 additions and 485 deletions

4
composer.lock generated
View file

@ -2520,12 +2520,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/appwrite/sdk-generator.git", "url": "https://github.com/appwrite/sdk-generator.git",
"reference": "d6f07d956f1ebfc8c582454be851c79afe76b3f0" "reference": "fc9d0a9125590871f233ebd5cf0441f1b3e387bd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/d6f07d956f1ebfc8c582454be851c79afe76b3f0", "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/d6f07d956f1ebfc8c582454be851c79afe76b3f0",
"reference": "d6f07d956f1ebfc8c582454be851c79afe76b3f0", "reference": "fc9d0a9125590871f233ebd5cf0441f1b3e387bd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.createAnonymousSession() { result in account.createAnonymousSession() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.createJWT() { result in account.createJWT() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.createMagicURLSession( account.createMagicURLSession(
email: "email@example.com" email: "email@example.com"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.createOAuth2Session( account.createOAuth2Session(
provider: "amazon" provider: "amazon"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.createRecovery( account.createRecovery(
email: "email@example.com", email: "email@example.com",
url: "https://example.com" url: "https://example.com"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.createSession( account.createSession(
email: "email@example.com", email: "email@example.com",
password: "password" password: "password"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.createVerification( account.createVerification(
url: "https://example.com" url: "https://example.com"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.create( account.create(
email: "email@example.com", email: "email@example.com",
password: "password" password: "password"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.deleteSession( account.deleteSession(
sessionId: "[SESSION_ID]" sessionId: "[SESSION_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.deleteSessions() { result in account.deleteSessions() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.delete() { result in account.delete() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.getLogs() { result in account.getLogs() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.getPrefs() { result in account.getPrefs() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.getSession( account.getSession(
sessionId: "[SESSION_ID]" sessionId: "[SESSION_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.getSessions() { result in account.getSessions() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.get() { result in account.get() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.updateEmail( account.updateEmail(
email: "email@example.com", email: "email@example.com",
password: "password" password: "password"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.updateMagicURLSession( account.updateMagicURLSession(
userId: "[USER_ID]", userId: "[USER_ID]",
secret: "[SECRET]" secret: "[SECRET]"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.updateName( account.updateName(
name: "[NAME]" name: "[NAME]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.updatePassword( account.updatePassword(
password: "password" password: "password"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.updatePrefs( account.updatePrefs(
prefs: prefs:
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.updateRecovery( account.updateRecovery(
userId: "[USER_ID]", userId: "[USER_ID]",
secret: "[SECRET]", secret: "[SECRET]",
@ -21,4 +20,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let account = Account(client: client) let account = Account(client)
account.updateVerification( account.updateVerification(
userId: "[USER_ID]", userId: "[USER_ID]",
secret: "[SECRET]" secret: "[SECRET]"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getBrowser( avatars.getBrowser(
code: "aa" code: "aa"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getCreditCard( avatars.getCreditCard(
code: "amex" code: "amex"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getFavicon( avatars.getFavicon(
url: "https://example.com" url: "https://example.com"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getFlag( avatars.getFlag(
code: "af" code: "af"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getImage( avatars.getImage(
url: "https://example.com" url: "https://example.com"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getInitials() { result in avatars.getInitials() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getQR( avatars.getQR(
text: "[TEXT]" text: "[TEXT]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let database = Database(client: client) let database = Database(client)
database.createDocument( database.createDocument(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
data: data:
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let database = Database(client: client) let database = Database(client)
database.deleteDocument( database.deleteDocument(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]" documentId: "[DOCUMENT_ID]"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let database = Database(client: client) let database = Database(client)
database.getDocument( database.getDocument(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]" documentId: "[DOCUMENT_ID]"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let database = Database(client: client) let database = Database(client)
database.listDocuments( database.listDocuments(
collectionId: "[COLLECTION_ID]" collectionId: "[COLLECTION_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let database = Database(client: client) let database = Database(client)
database.updateDocument( database.updateDocument(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]", documentId: "[DOCUMENT_ID]",
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let functions = Functions(client: client) let functions = Functions(client)
functions.createExecution( functions.createExecution(
functionId: "[FUNCTION_ID]" functionId: "[FUNCTION_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let functions = Functions(client: client) let functions = Functions(client)
functions.getExecution( functions.getExecution(
functionId: "[FUNCTION_ID]", functionId: "[FUNCTION_ID]",
executionId: "[EXECUTION_ID]" executionId: "[EXECUTION_ID]"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let functions = Functions(client: client) let functions = Functions(client)
functions.listExecutions( functions.listExecutions(
functionId: "[FUNCTION_ID]" functionId: "[FUNCTION_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client: client) let locale = Locale(client)
locale.getContinents() { result in locale.getContinents() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client: client) let locale = Locale(client)
locale.getCountriesEU() { result in locale.getCountriesEU() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client: client) let locale = Locale(client)
locale.getCountriesPhones() { result in locale.getCountriesPhones() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client: client) let locale = Locale(client)
locale.getCountries() { result in locale.getCountries() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client: client) let locale = Locale(client)
locale.getCurrencies() { result in locale.getCurrencies() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client: client) let locale = Locale(client)
locale.getLanguages() { result in locale.getLanguages() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let locale = Locale(client: client) let locale = Locale(client)
locale.get() { result in locale.get() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client: client) let storage = Storage(client)
storage.createFile( storage.createFile(
file: File(name: "image.jpg", buffer: yourByteBuffer) file: File(name: "image.jpg", buffer: yourByteBuffer)
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client: client) let storage = Storage(client)
storage.deleteFile( storage.deleteFile(
fileId: "[FILE_ID]" fileId: "[FILE_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client: client) let storage = Storage(client)
storage.getFileDownload( storage.getFileDownload(
fileId: "[FILE_ID]" fileId: "[FILE_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client: client) let storage = Storage(client)
storage.getFilePreview( storage.getFilePreview(
fileId: "[FILE_ID]" fileId: "[FILE_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client: client) let storage = Storage(client)
storage.getFileView( storage.getFileView(
fileId: "[FILE_ID]" fileId: "[FILE_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client: client) let storage = Storage(client)
storage.getFile( storage.getFile(
fileId: "[FILE_ID]" fileId: "[FILE_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client: client) let storage = Storage(client)
storage.listFiles() { result in storage.listFiles() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let storage = Storage(client: client) let storage = Storage(client)
storage.updateFile( storage.updateFile(
fileId: "[FILE_ID]", fileId: "[FILE_ID]",
read: [], read: [],
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.createMembership( teams.createMembership(
teamId: "[TEAM_ID]", teamId: "[TEAM_ID]",
email: "email@example.com", email: "email@example.com",
@ -21,4 +20,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.create( teams.create(
name: "[NAME]" name: "[NAME]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.deleteMembership( teams.deleteMembership(
teamId: "[TEAM_ID]", teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]" membershipId: "[MEMBERSHIP_ID]"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.delete( teams.delete(
teamId: "[TEAM_ID]" teamId: "[TEAM_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.getMemberships( teams.getMemberships(
teamId: "[TEAM_ID]" teamId: "[TEAM_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.get( teams.get(
teamId: "[TEAM_ID]" teamId: "[TEAM_ID]"
) { result in ) { result in
@ -18,4 +17,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.list() { result in teams.list() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -16,4 +15,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.updateMembershipRoles( teams.updateMembershipRoles(
teamId: "[TEAM_ID]", teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]", membershipId: "[MEMBERSHIP_ID]",
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.updateMembershipStatus( teams.updateMembershipStatus(
teamId: "[TEAM_ID]", teamId: "[TEAM_ID]",
membershipId: "[MEMBERSHIP_ID]", membershipId: "[MEMBERSHIP_ID]",
@ -21,4 +20,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -6,7 +5,7 @@ func main() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
let teams = Teams(client: client) let teams = Teams(client)
teams.update( teams.update(
teamId: "[TEAM_ID]", teamId: "[TEAM_ID]",
name: "[NAME]" name: "[NAME]"
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.createRecovery( account.createRecovery(
email: "email@example.com", email: "email@example.com",
url: "https://example.com" url: "https://example.com"
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.createVerification( account.createVerification(
url: "https://example.com" url: "https://example.com"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.deleteSession( account.deleteSession(
sessionId: "[SESSION_ID]" sessionId: "[SESSION_ID]"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.deleteSessions() { result in account.deleteSessions() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -17,4 +16,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.delete() { result in account.delete() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -17,4 +16,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.getLogs() { result in account.getLogs() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -17,4 +16,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.getPrefs() { result in account.getPrefs() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -17,4 +16,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.getSession( account.getSession(
sessionId: "[SESSION_ID]" sessionId: "[SESSION_ID]"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.getSessions() { result in account.getSessions() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -17,4 +16,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.get() { result in account.get() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -17,4 +16,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.updateEmail( account.updateEmail(
email: "email@example.com", email: "email@example.com",
password: "password" password: "password"
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.updateName( account.updateName(
name: "[NAME]" name: "[NAME]"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.updatePassword( account.updatePassword(
password: "password" password: "password"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.updatePrefs( account.updatePrefs(
prefs: prefs:
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.updateRecovery( account.updateRecovery(
userId: "[USER_ID]", userId: "[USER_ID]",
secret: "[SECRET]", secret: "[SECRET]",
@ -22,4 +21,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
let account = Account(client: client) let account = Account(client)
account.updateVerification( account.updateVerification(
userId: "[USER_ID]", userId: "[USER_ID]",
secret: "[SECRET]" secret: "[SECRET]"
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getBrowser( avatars.getBrowser(
code: "aa" code: "aa"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getCreditCard( avatars.getCreditCard(
code: "amex" code: "amex"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getFavicon( avatars.getFavicon(
url: "https://example.com" url: "https://example.com"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getFlag( avatars.getFlag(
code: "af" code: "af"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getImage( avatars.getImage(
url: "https://example.com" url: "https://example.com"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getInitials() { result in avatars.getInitials() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -17,4 +16,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let avatars = Avatars(client: client) let avatars = Avatars(client)
avatars.getQR( avatars.getQR(
text: "[TEXT]" text: "[TEXT]"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.createCollection( database.createCollection(
name: "[NAME]", name: "[NAME]",
read: [], read: [],
@ -22,4 +21,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.createDocument( database.createDocument(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
data: data:
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.deleteCollection( database.deleteCollection(
collectionId: "[COLLECTION_ID]" collectionId: "[COLLECTION_ID]"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.deleteDocument( database.deleteDocument(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]" documentId: "[DOCUMENT_ID]"
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.getCollection( database.getCollection(
collectionId: "[COLLECTION_ID]" collectionId: "[COLLECTION_ID]"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.getDocument( database.getDocument(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]" documentId: "[DOCUMENT_ID]"
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.listCollections() { result in database.listCollections() { result in
switch result { switch result {
case .failure(let error): case .failure(let error):
@ -17,4 +16,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.listDocuments( database.listDocuments(
collectionId: "[COLLECTION_ID]" collectionId: "[COLLECTION_ID]"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.updateCollection( database.updateCollection(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
name: "[NAME]" name: "[NAME]"
@ -20,4 +19,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let database = Database(client: client) let database = Database(client)
database.updateDocument( database.updateDocument(
collectionId: "[COLLECTION_ID]", collectionId: "[COLLECTION_ID]",
documentId: "[DOCUMENT_ID]", documentId: "[DOCUMENT_ID]",
@ -21,4 +20,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let functions = Functions(client: client) let functions = Functions(client)
functions.createExecution( functions.createExecution(
functionId: "[FUNCTION_ID]" functionId: "[FUNCTION_ID]"
) { result in ) { result in
@ -19,4 +18,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let functions = Functions(client: client) let functions = Functions(client)
functions.createTag( functions.createTag(
functionId: "[FUNCTION_ID]", functionId: "[FUNCTION_ID]",
command: "[COMMAND]", command: "[COMMAND]",
@ -21,4 +20,3 @@ func main() {
} }
} }
} }
```

View file

@ -1,4 +1,3 @@
```swift
import Appwrite import Appwrite
func main() { func main() {
@ -7,7 +6,7 @@ func main() {
.setProject("5df5acd0d48c2") // Your project ID .setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let functions = Functions(client: client) let functions = Functions(client)
functions.create( functions.create(
name: "[NAME]", name: "[NAME]",
execute: [], execute: [],
@ -21,4 +20,3 @@ func main() {
} }
} }
} }
```

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