Update Apple + Swift examples
This commit is contained in:
parent
90904ab676
commit
e5ba262742
162 changed files with 163 additions and 485 deletions
4
composer.lock
generated
4
composer.lock
generated
|
@ -2520,12 +2520,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator.git",
|
||||
"reference": "d6f07d956f1ebfc8c582454be851c79afe76b3f0"
|
||||
"reference": "fc9d0a9125590871f233ebd5cf0441f1b3e387bd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/d6f07d956f1ebfc8c582454be851c79afe76b3f0",
|
||||
"reference": "d6f07d956f1ebfc8c582454be851c79afe76b3f0",
|
||||
"reference": "fc9d0a9125590871f233ebd5cf0441f1b3e387bd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createAnonymousSession() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createJWT() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createMagicURLSession(
|
||||
email: "email@example.com"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createOAuth2Session(
|
||||
provider: "amazon"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createRecovery(
|
||||
email: "email@example.com",
|
||||
url: "https://example.com"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createSession(
|
||||
email: "email@example.com",
|
||||
password: "password"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createVerification(
|
||||
url: "https://example.com"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.create(
|
||||
email: "email@example.com",
|
||||
password: "password"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.deleteSession(
|
||||
sessionId: "[SESSION_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.deleteSessions() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.delete() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.getLogs() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.getPrefs() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.getSession(
|
||||
sessionId: "[SESSION_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.getSessions() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.get() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateEmail(
|
||||
email: "email@example.com",
|
||||
password: "password"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateMagicURLSession(
|
||||
userId: "[USER_ID]",
|
||||
secret: "[SECRET]"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateName(
|
||||
name: "[NAME]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updatePassword(
|
||||
password: "password"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updatePrefs(
|
||||
prefs:
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateRecovery(
|
||||
userId: "[USER_ID]",
|
||||
secret: "[SECRET]",
|
||||
|
@ -21,4 +20,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateVerification(
|
||||
userId: "[USER_ID]",
|
||||
secret: "[SECRET]"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getBrowser(
|
||||
code: "aa"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getCreditCard(
|
||||
code: "amex"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getFavicon(
|
||||
url: "https://example.com"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getFlag(
|
||||
code: "af"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getImage(
|
||||
url: "https://example.com"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getInitials() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getQR(
|
||||
text: "[TEXT]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.createDocument(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
data:
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.deleteDocument(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
documentId: "[DOCUMENT_ID]"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.getDocument(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
documentId: "[DOCUMENT_ID]"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.listDocuments(
|
||||
collectionId: "[COLLECTION_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.updateDocument(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
documentId: "[DOCUMENT_ID]",
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let functions = Functions(client: client)
|
||||
let functions = Functions(client)
|
||||
functions.createExecution(
|
||||
functionId: "[FUNCTION_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let functions = Functions(client: client)
|
||||
let functions = Functions(client)
|
||||
functions.getExecution(
|
||||
functionId: "[FUNCTION_ID]",
|
||||
executionId: "[EXECUTION_ID]"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let functions = Functions(client: client)
|
||||
let functions = Functions(client)
|
||||
functions.listExecutions(
|
||||
functionId: "[FUNCTION_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let locale = Locale(client: client)
|
||||
let locale = Locale(client)
|
||||
locale.getContinents() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let locale = Locale(client: client)
|
||||
let locale = Locale(client)
|
||||
locale.getCountriesEU() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let locale = Locale(client: client)
|
||||
let locale = Locale(client)
|
||||
locale.getCountriesPhones() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let locale = Locale(client: client)
|
||||
let locale = Locale(client)
|
||||
locale.getCountries() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let locale = Locale(client: client)
|
||||
let locale = Locale(client)
|
||||
locale.getCurrencies() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let locale = Locale(client: client)
|
||||
let locale = Locale(client)
|
||||
locale.getLanguages() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let locale = Locale(client: client)
|
||||
let locale = Locale(client)
|
||||
locale.get() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let storage = Storage(client: client)
|
||||
let storage = Storage(client)
|
||||
storage.createFile(
|
||||
file: File(name: "image.jpg", buffer: yourByteBuffer)
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let storage = Storage(client: client)
|
||||
let storage = Storage(client)
|
||||
storage.deleteFile(
|
||||
fileId: "[FILE_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let storage = Storage(client: client)
|
||||
let storage = Storage(client)
|
||||
storage.getFileDownload(
|
||||
fileId: "[FILE_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let storage = Storage(client: client)
|
||||
let storage = Storage(client)
|
||||
storage.getFilePreview(
|
||||
fileId: "[FILE_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let storage = Storage(client: client)
|
||||
let storage = Storage(client)
|
||||
storage.getFileView(
|
||||
fileId: "[FILE_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let storage = Storage(client: client)
|
||||
let storage = Storage(client)
|
||||
storage.getFile(
|
||||
fileId: "[FILE_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let storage = Storage(client: client)
|
||||
let storage = Storage(client)
|
||||
storage.listFiles() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let storage = Storage(client: client)
|
||||
let storage = Storage(client)
|
||||
storage.updateFile(
|
||||
fileId: "[FILE_ID]",
|
||||
read: [],
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.createMembership(
|
||||
teamId: "[TEAM_ID]",
|
||||
email: "email@example.com",
|
||||
|
@ -21,4 +20,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.create(
|
||||
name: "[NAME]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.deleteMembership(
|
||||
teamId: "[TEAM_ID]",
|
||||
membershipId: "[MEMBERSHIP_ID]"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.delete(
|
||||
teamId: "[TEAM_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.getMemberships(
|
||||
teamId: "[TEAM_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.get(
|
||||
teamId: "[TEAM_ID]"
|
||||
) { result in
|
||||
|
@ -18,4 +17,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.list() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -16,4 +15,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.updateMembershipRoles(
|
||||
teamId: "[TEAM_ID]",
|
||||
membershipId: "[MEMBERSHIP_ID]",
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.updateMembershipStatus(
|
||||
teamId: "[TEAM_ID]",
|
||||
membershipId: "[MEMBERSHIP_ID]",
|
||||
|
@ -21,4 +20,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -6,7 +5,7 @@ func main() {
|
|||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
let teams = Teams(client: client)
|
||||
let teams = Teams(client)
|
||||
teams.update(
|
||||
teamId: "[TEAM_ID]",
|
||||
name: "[NAME]"
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createRecovery(
|
||||
email: "email@example.com",
|
||||
url: "https://example.com"
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.createVerification(
|
||||
url: "https://example.com"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.deleteSession(
|
||||
sessionId: "[SESSION_ID]"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.deleteSessions() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -17,4 +16,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.delete() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -17,4 +16,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.getLogs() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -17,4 +16,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.getPrefs() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -17,4 +16,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.getSession(
|
||||
sessionId: "[SESSION_ID]"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.getSessions() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -17,4 +16,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.get() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -17,4 +16,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateEmail(
|
||||
email: "email@example.com",
|
||||
password: "password"
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateName(
|
||||
name: "[NAME]"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updatePassword(
|
||||
password: "password"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updatePrefs(
|
||||
prefs:
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateRecovery(
|
||||
userId: "[USER_ID]",
|
||||
secret: "[SECRET]",
|
||||
|
@ -22,4 +21,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token
|
||||
|
||||
let account = Account(client: client)
|
||||
let account = Account(client)
|
||||
account.updateVerification(
|
||||
userId: "[USER_ID]",
|
||||
secret: "[SECRET]"
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getBrowser(
|
||||
code: "aa"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getCreditCard(
|
||||
code: "amex"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getFavicon(
|
||||
url: "https://example.com"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getFlag(
|
||||
code: "af"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getImage(
|
||||
url: "https://example.com"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getInitials() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -17,4 +16,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let avatars = Avatars(client: client)
|
||||
let avatars = Avatars(client)
|
||||
avatars.getQR(
|
||||
text: "[TEXT]"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.createCollection(
|
||||
name: "[NAME]",
|
||||
read: [],
|
||||
|
@ -22,4 +21,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.createDocument(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
data:
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.deleteCollection(
|
||||
collectionId: "[COLLECTION_ID]"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.deleteDocument(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
documentId: "[DOCUMENT_ID]"
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.getCollection(
|
||||
collectionId: "[COLLECTION_ID]"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.getDocument(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
documentId: "[DOCUMENT_ID]"
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.listCollections() { result in
|
||||
switch result {
|
||||
case .failure(let error):
|
||||
|
@ -17,4 +16,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.listDocuments(
|
||||
collectionId: "[COLLECTION_ID]"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.updateCollection(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
name: "[NAME]"
|
||||
|
@ -20,4 +19,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let database = Database(client: client)
|
||||
let database = Database(client)
|
||||
database.updateDocument(
|
||||
collectionId: "[COLLECTION_ID]",
|
||||
documentId: "[DOCUMENT_ID]",
|
||||
|
@ -21,4 +20,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let functions = Functions(client: client)
|
||||
let functions = Functions(client)
|
||||
functions.createExecution(
|
||||
functionId: "[FUNCTION_ID]"
|
||||
) { result in
|
||||
|
@ -19,4 +18,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let functions = Functions(client: client)
|
||||
let functions = Functions(client)
|
||||
functions.createTag(
|
||||
functionId: "[FUNCTION_ID]",
|
||||
command: "[COMMAND]",
|
||||
|
@ -21,4 +20,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,4 +1,3 @@
|
|||
```swift
|
||||
import Appwrite
|
||||
|
||||
func main() {
|
||||
|
@ -7,7 +6,7 @@ func main() {
|
|||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
||||
|
||||
let functions = Functions(client: client)
|
||||
let functions = Functions(client)
|
||||
functions.create(
|
||||
name: "[NAME]",
|
||||
execute: [],
|
||||
|
@ -21,4 +20,3 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue