diff --git a/CHANGELOG.md b/CHANGELOG.md index fa4d35e..c7194d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,29 @@ -# Change Log \ No newline at end of file +# Change Log + +## 9.1.0 + +* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service +* Add `dart38` and `flutter332` support to runtime models +* Add `gif` support to `ImageFormat` enum +* Add `encrypt` support to `StringAttribute` model +* Add `sequence` support to `Document` model + +## 9.0.0 + +* Add `` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 8.0.0 + +* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests + +## 7.0.0 + +* Fix pong response & chunked upload diff --git a/LICENSE.md b/LICENSE.md index 5479bb8..c1602fc 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors. +Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 5786e19..8469be2 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ ![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square) ![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-kotlin/releases).** +**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-kotlin/releases).** > This is the Kotlin SDK for integrating with Appwrite from your Kotlin server-side code. If you're looking for the Android SDK you should check [appwrite/sdk-for-android](https://github.com/appwrite/sdk-for-android) @@ -39,7 +39,7 @@ repositories { Next, add the dependency to your project's `build.gradle(.kts)` file: ```groovy -implementation("io.appwrite:sdk-for-kotlin:6.2.0") +implementation("io.appwrite:sdk-for-kotlin:10.0.0") ``` ### Maven @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file: io.appwrite sdk-for-kotlin - 6.2.0 + 10.0.0 ``` @@ -115,6 +115,132 @@ suspend fun main() { } ``` +### Type Safety with Models + +The Appwrite Kotlin SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a `nestedType` parameter that allows you to specify your custom model type for full type safety. + +**Kotlin:** +```kotlin +data class Book( + val name: String, + val author: String, + val releaseYear: String? = null, + val category: String? = null, + val genre: List? = null, + val isCheckedOut: Boolean +) + +val databases = Databases(client) + +try { + val documents = databases.listDocuments( + databaseId = "your-database-id", + collectionId = "your-collection-id", + nestedType = Book::class.java // Pass in your custom model type + ) + + for (book in documents.documents) { + Log.d("Appwrite", "Book: ${book.name} by ${book.author}") // Now you have full type safety + } +} catch (e: AppwriteException) { + Log.e("Appwrite", e.message ?: "Unknown error") +} +``` + +**Java:** +```java +public class Book { + private String name; + private String author; + private String releaseYear; + private String category; + private List genre; + private boolean isCheckedOut; + + // Constructor + public Book(String name, String author, boolean isCheckedOut) { + this.name = name; + this.author = author; + this.isCheckedOut = isCheckedOut; + } + + // Getters and setters + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + public String getAuthor() { return author; } + public void setAuthor(String author) { this.author = author; } + + public String getReleaseYear() { return releaseYear; } + public void setReleaseYear(String releaseYear) { this.releaseYear = releaseYear; } + + public String getCategory() { return category; } + public void setCategory(String category) { this.category = category; } + + public List getGenre() { return genre; } + public void setGenre(List genre) { this.genre = genre; } + + public boolean isCheckedOut() { return isCheckedOut; } + public void setCheckedOut(boolean checkedOut) { isCheckedOut = checkedOut; } +} + +Databases databases = new Databases(client); + +try { + DocumentList documents = databases.listDocuments( + "your-database-id", + "your-collection-id", + Book.class // Pass in your custom model type + ); + + for (Book book : documents.getDocuments()) { + Log.d("Appwrite", "Book: " + book.getName() + " by " + book.getAuthor()); // Now you have full type safety + } +} catch (AppwriteException e) { + Log.e("Appwrite", e.getMessage() != null ? e.getMessage() : "Unknown error"); +} +``` + +**Tip**: You can use the `appwrite types` command to automatically generate model definitions based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation). + +### Working with Model Methods + +All Appwrite models come with built-in methods for data conversion and manipulation: + +**`toMap()`** - Converts a model instance to a Map format, useful for debugging or manual data manipulation: +```kotlin +val account = Account(client) +val user = account.get() +val userMap = user.toMap() +Log.d("Appwrite", userMap.toString()) // Prints all user properties as a Map +``` + +**`from(map:, nestedType:)`** - Creates a model instance from a Map, useful when working with raw data: +```kotlin +val userData: Map = mapOf( + "\$id" to "123", + "name" to "John", + "email" to "john@example.com" +) +val user = User.from(userData, User::class.java) +``` + +**JSON Serialization** - Models can be easily converted to/from JSON using Gson (which the SDK uses internally): +```kotlin +import com.google.gson.Gson + +val account = Account(client) +val user = account.get() + +// Convert to JSON +val gson = Gson() +val jsonString = gson.toJson(user) +Log.d("Appwrite", "User JSON: $jsonString") + +// Convert from JSON +val userFromJson = gson.fromJson(jsonString, User::class.java) +``` + ### Error Handling The Appwrite Kotlin SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example. diff --git a/docs/examples/java/account/create-anonymous-session.md b/docs/examples/java/account/create-anonymous-session.md index 0ba9c69..d65c20a 100644 --- a/docs/examples/java/account/create-anonymous-session.md +++ b/docs/examples/java/account/create-anonymous-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/create-email-password-session.md b/docs/examples/java/account/create-email-password-session.md index 75fa73f..6339310 100644 --- a/docs/examples/java/account/create-email-password-session.md +++ b/docs/examples/java/account/create-email-password-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/create-email-token.md b/docs/examples/java/account/create-email-token.md index eff6d43..7a6a0d7 100644 --- a/docs/examples/java/account/create-email-token.md +++ b/docs/examples/java/account/create-email-token.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/create-j-w-t.md b/docs/examples/java/account/create-jwt.md similarity index 84% rename from docs/examples/java/account/create-j-w-t.md rename to docs/examples/java/account/create-jwt.md index 285d1e0..3756ede 100644 --- a/docs/examples/java/account/create-j-w-t.md +++ b/docs/examples/java/account/create-jwt.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/create-magic-u-r-l-token.md b/docs/examples/java/account/create-magic-url-token.md similarity index 88% rename from docs/examples/java/account/create-magic-u-r-l-token.md rename to docs/examples/java/account/create-magic-url-token.md index 3f9bda2..df021f9 100644 --- a/docs/examples/java/account/create-magic-u-r-l-token.md +++ b/docs/examples/java/account/create-magic-url-token.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/create-mfa-authenticator.md b/docs/examples/java/account/create-mfa-authenticator.md index eb127bd..d38ddd3 100644 --- a/docs/examples/java/account/create-mfa-authenticator.md +++ b/docs/examples/java/account/create-mfa-authenticator.md @@ -4,13 +4,13 @@ import io.appwrite.services.Account; import io.appwrite.enums.AuthenticatorType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with Account account = new Account(client); -account.createMfaAuthenticator( +account.createMFAAuthenticator( AuthenticatorType.TOTP, // type new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/account/create-mfa-challenge.md b/docs/examples/java/account/create-mfa-challenge.md index e5fcbe9..5c048cb 100644 --- a/docs/examples/java/account/create-mfa-challenge.md +++ b/docs/examples/java/account/create-mfa-challenge.md @@ -4,12 +4,12 @@ import io.appwrite.services.Account; import io.appwrite.enums.AuthenticationFactor; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); -account.createMfaChallenge( +account.createMFAChallenge( AuthenticationFactor.EMAIL, // factor new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/account/create-mfa-recovery-codes.md b/docs/examples/java/account/create-mfa-recovery-codes.md index b64fb7d..6a47a17 100644 --- a/docs/examples/java/account/create-mfa-recovery-codes.md +++ b/docs/examples/java/account/create-mfa-recovery-codes.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with Account account = new Account(client); -account.createMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> { +account.createMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; diff --git a/docs/examples/java/account/create-o-auth2token.md b/docs/examples/java/account/create-o-auth-2-token.md similarity index 89% rename from docs/examples/java/account/create-o-auth2token.md rename to docs/examples/java/account/create-o-auth-2-token.md index 47873c5..5b325f5 100644 --- a/docs/examples/java/account/create-o-auth2token.md +++ b/docs/examples/java/account/create-o-auth-2-token.md @@ -4,7 +4,7 @@ import io.appwrite.services.Account; import io.appwrite.enums.OAuthProvider; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/create-phone-token.md b/docs/examples/java/account/create-phone-token.md index 1f7c05c..14fb812 100644 --- a/docs/examples/java/account/create-phone-token.md +++ b/docs/examples/java/account/create-phone-token.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/create-phone-verification.md b/docs/examples/java/account/create-phone-verification.md index 07937ab..9e49c62 100644 --- a/docs/examples/java/account/create-phone-verification.md +++ b/docs/examples/java/account/create-phone-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/create-recovery.md b/docs/examples/java/account/create-recovery.md index d74106b..f529ea4 100644 --- a/docs/examples/java/account/create-recovery.md +++ b/docs/examples/java/account/create-recovery.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/create-session.md b/docs/examples/java/account/create-session.md index 861af3d..5bcdf99 100644 --- a/docs/examples/java/account/create-session.md +++ b/docs/examples/java/account/create-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/create-verification.md b/docs/examples/java/account/create-verification.md index 4479cc6..65c8e8b 100644 --- a/docs/examples/java/account/create-verification.md +++ b/docs/examples/java/account/create-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/create.md b/docs/examples/java/account/create.md index 3bcfe1d..d24bfb8 100644 --- a/docs/examples/java/account/create.md +++ b/docs/examples/java/account/create.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/delete-identity.md b/docs/examples/java/account/delete-identity.md index 5eec242..0d6f860 100644 --- a/docs/examples/java/account/delete-identity.md +++ b/docs/examples/java/account/delete-identity.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/delete-mfa-authenticator.md b/docs/examples/java/account/delete-mfa-authenticator.md index 7f3b6b9..20a6acd 100644 --- a/docs/examples/java/account/delete-mfa-authenticator.md +++ b/docs/examples/java/account/delete-mfa-authenticator.md @@ -4,13 +4,13 @@ import io.appwrite.services.Account; import io.appwrite.enums.AuthenticatorType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with Account account = new Account(client); -account.deleteMfaAuthenticator( +account.deleteMFAAuthenticator( AuthenticatorType.TOTP, // type new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/account/delete-session.md b/docs/examples/java/account/delete-session.md index 687df81..fd27d74 100644 --- a/docs/examples/java/account/delete-session.md +++ b/docs/examples/java/account/delete-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/delete-sessions.md b/docs/examples/java/account/delete-sessions.md index 0bfa1f2..11076e7 100644 --- a/docs/examples/java/account/delete-sessions.md +++ b/docs/examples/java/account/delete-sessions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/get-mfa-recovery-codes.md b/docs/examples/java/account/get-mfa-recovery-codes.md index f99634d..813a0a6 100644 --- a/docs/examples/java/account/get-mfa-recovery-codes.md +++ b/docs/examples/java/account/get-mfa-recovery-codes.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with Account account = new Account(client); -account.getMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> { +account.getMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; diff --git a/docs/examples/java/account/get-prefs.md b/docs/examples/java/account/get-prefs.md index 46d4181..6614f92 100644 --- a/docs/examples/java/account/get-prefs.md +++ b/docs/examples/java/account/get-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/get-session.md b/docs/examples/java/account/get-session.md index 6d07a85..3f30d90 100644 --- a/docs/examples/java/account/get-session.md +++ b/docs/examples/java/account/get-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/get.md b/docs/examples/java/account/get.md index 6d0eb40..70e2dfb 100644 --- a/docs/examples/java/account/get.md +++ b/docs/examples/java/account/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/list-identities.md b/docs/examples/java/account/list-identities.md index 8977a23..ceb4b30 100644 --- a/docs/examples/java/account/list-identities.md +++ b/docs/examples/java/account/list-identities.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/list-logs.md b/docs/examples/java/account/list-logs.md index e26cab9..de22fce 100644 --- a/docs/examples/java/account/list-logs.md +++ b/docs/examples/java/account/list-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/list-mfa-factors.md b/docs/examples/java/account/list-mfa-factors.md index 74f3e53..0bdc378 100644 --- a/docs/examples/java/account/list-mfa-factors.md +++ b/docs/examples/java/account/list-mfa-factors.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with Account account = new Account(client); -account.listMfaFactors(new CoroutineCallback<>((result, error) -> { +account.listMFAFactors(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; diff --git a/docs/examples/java/account/list-sessions.md b/docs/examples/java/account/list-sessions.md index 6b01d44..557832d 100644 --- a/docs/examples/java/account/list-sessions.md +++ b/docs/examples/java/account/list-sessions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-email.md b/docs/examples/java/account/update-email.md index 391e531..8529ba6 100644 --- a/docs/examples/java/account/update-email.md +++ b/docs/examples/java/account/update-email.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-magic-u-r-l-session.md b/docs/examples/java/account/update-magic-url-session.md similarity index 86% rename from docs/examples/java/account/update-magic-u-r-l-session.md rename to docs/examples/java/account/update-magic-url-session.md index 62fe856..b4735f4 100644 --- a/docs/examples/java/account/update-magic-u-r-l-session.md +++ b/docs/examples/java/account/update-magic-url-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/update-mfa-authenticator.md b/docs/examples/java/account/update-mfa-authenticator.md index b492d8c..87e3852 100644 --- a/docs/examples/java/account/update-mfa-authenticator.md +++ b/docs/examples/java/account/update-mfa-authenticator.md @@ -4,13 +4,13 @@ import io.appwrite.services.Account; import io.appwrite.enums.AuthenticatorType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with Account account = new Account(client); -account.updateMfaAuthenticator( +account.updateMFAAuthenticator( AuthenticatorType.TOTP, // type "", // otp new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/account/update-mfa-challenge.md b/docs/examples/java/account/update-mfa-challenge.md index 74ca481..5e1bebe 100644 --- a/docs/examples/java/account/update-mfa-challenge.md +++ b/docs/examples/java/account/update-mfa-challenge.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with Account account = new Account(client); -account.updateMfaChallenge( +account.updateMFAChallenge( "", // challengeId "", // otp new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/account/update-mfa-recovery-codes.md b/docs/examples/java/account/update-mfa-recovery-codes.md index 8f38ad8..7c303dd 100644 --- a/docs/examples/java/account/update-mfa-recovery-codes.md +++ b/docs/examples/java/account/update-mfa-recovery-codes.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with Account account = new Account(client); -account.updateMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> { +account.updateMFARecoveryCodes(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; diff --git a/docs/examples/java/account/update-m-f-a.md b/docs/examples/java/account/update-mfa.md similarity index 87% rename from docs/examples/java/account/update-m-f-a.md rename to docs/examples/java/account/update-mfa.md index 58ac56b..d1b60c5 100644 --- a/docs/examples/java/account/update-m-f-a.md +++ b/docs/examples/java/account/update-mfa.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-name.md b/docs/examples/java/account/update-name.md index 1ce2abf..749fe26 100644 --- a/docs/examples/java/account/update-name.md +++ b/docs/examples/java/account/update-name.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-password.md b/docs/examples/java/account/update-password.md index 437e825..8eaa08b 100644 --- a/docs/examples/java/account/update-password.md +++ b/docs/examples/java/account/update-password.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-phone-session.md b/docs/examples/java/account/update-phone-session.md index c401de4..cbfdca5 100644 --- a/docs/examples/java/account/update-phone-session.md +++ b/docs/examples/java/account/update-phone-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject(""); // Your project ID Account account = new Account(client); diff --git a/docs/examples/java/account/update-phone-verification.md b/docs/examples/java/account/update-phone-verification.md index ddf786a..9988265 100644 --- a/docs/examples/java/account/update-phone-verification.md +++ b/docs/examples/java/account/update-phone-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-phone.md b/docs/examples/java/account/update-phone.md index 6a47fd1..d54aa9c 100644 --- a/docs/examples/java/account/update-phone.md +++ b/docs/examples/java/account/update-phone.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-prefs.md b/docs/examples/java/account/update-prefs.md index 8c10ede..0e900d0 100644 --- a/docs/examples/java/account/update-prefs.md +++ b/docs/examples/java/account/update-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-recovery.md b/docs/examples/java/account/update-recovery.md index be4301c..8ab16e1 100644 --- a/docs/examples/java/account/update-recovery.md +++ b/docs/examples/java/account/update-recovery.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-session.md b/docs/examples/java/account/update-session.md index 96e3506..8233c05 100644 --- a/docs/examples/java/account/update-session.md +++ b/docs/examples/java/account/update-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-status.md b/docs/examples/java/account/update-status.md index 7c42f35..d5f4f79 100644 --- a/docs/examples/java/account/update-status.md +++ b/docs/examples/java/account/update-status.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/account/update-verification.md b/docs/examples/java/account/update-verification.md index ed8a40b..dafe6db 100644 --- a/docs/examples/java/account/update-verification.md +++ b/docs/examples/java/account/update-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Account; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/avatars/get-browser.md b/docs/examples/java/avatars/get-browser.md index 4cd18b6..9c3433e 100644 --- a/docs/examples/java/avatars/get-browser.md +++ b/docs/examples/java/avatars/get-browser.md @@ -4,7 +4,7 @@ import io.appwrite.services.Avatars; import io.appwrite.enums.Browser; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with @@ -14,7 +14,7 @@ avatars.getBrowser( Browser.AVANT_BROWSER, // code 0, // width (optional) 0, // height (optional) - 0, // quality (optional) + -1, // quality (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/avatars/get-credit-card.md b/docs/examples/java/avatars/get-credit-card.md index eadbf5d..6904638 100644 --- a/docs/examples/java/avatars/get-credit-card.md +++ b/docs/examples/java/avatars/get-credit-card.md @@ -4,7 +4,7 @@ import io.appwrite.services.Avatars; import io.appwrite.enums.CreditCard; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with @@ -14,7 +14,7 @@ avatars.getCreditCard( CreditCard.AMERICAN_EXPRESS, // code 0, // width (optional) 0, // height (optional) - 0, // quality (optional) + -1, // quality (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/avatars/get-favicon.md b/docs/examples/java/avatars/get-favicon.md index 9f51941..f4e89cf 100644 --- a/docs/examples/java/avatars/get-favicon.md +++ b/docs/examples/java/avatars/get-favicon.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Avatars; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/avatars/get-flag.md b/docs/examples/java/avatars/get-flag.md index 1b7f423..159dcdc 100644 --- a/docs/examples/java/avatars/get-flag.md +++ b/docs/examples/java/avatars/get-flag.md @@ -4,7 +4,7 @@ import io.appwrite.services.Avatars; import io.appwrite.enums.Flag; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with @@ -14,7 +14,7 @@ avatars.getFlag( Flag.AFGHANISTAN, // code 0, // width (optional) 0, // height (optional) - 0, // quality (optional) + -1, // quality (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/avatars/get-image.md b/docs/examples/java/avatars/get-image.md index af5f217..afad760 100644 --- a/docs/examples/java/avatars/get-image.md +++ b/docs/examples/java/avatars/get-image.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Avatars; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/avatars/get-initials.md b/docs/examples/java/avatars/get-initials.md index 4b00f73..171b636 100644 --- a/docs/examples/java/avatars/get-initials.md +++ b/docs/examples/java/avatars/get-initials.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Avatars; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/avatars/get-q-r.md b/docs/examples/java/avatars/get-qr.md similarity index 88% rename from docs/examples/java/avatars/get-q-r.md rename to docs/examples/java/avatars/get-qr.md index 903e2b0..113fd1f 100644 --- a/docs/examples/java/avatars/get-q-r.md +++ b/docs/examples/java/avatars/get-qr.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Avatars; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/databases/create-boolean-attribute.md b/docs/examples/java/databases/create-boolean-attribute.md index d959a65..7585471 100644 --- a/docs/examples/java/databases/create-boolean-attribute.md +++ b/docs/examples/java/databases/create-boolean-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-collection.md b/docs/examples/java/databases/create-collection.md index 9a17b26..8ec51e6 100644 --- a/docs/examples/java/databases/create-collection.md +++ b/docs/examples/java/databases/create-collection.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-datetime-attribute.md b/docs/examples/java/databases/create-datetime-attribute.md index b35d489..d95e048 100644 --- a/docs/examples/java/databases/create-datetime-attribute.md +++ b/docs/examples/java/databases/create-datetime-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-document.md b/docs/examples/java/databases/create-document.md index e05d1fe..5231be3 100644 --- a/docs/examples/java/databases/create-document.md +++ b/docs/examples/java/databases/create-document.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/databases/create-documents.md b/docs/examples/java/databases/create-documents.md new file mode 100644 index 0000000..0de0c27 --- /dev/null +++ b/docs/examples/java/databases/create-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Databases databases = new Databases(client); + +databases.createDocuments( + "", // databaseId + "", // collectionId + listOf(), // documents + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/databases/create-email-attribute.md b/docs/examples/java/databases/create-email-attribute.md index 5a42e97..b2ecc99 100644 --- a/docs/examples/java/databases/create-email-attribute.md +++ b/docs/examples/java/databases/create-email-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-enum-attribute.md b/docs/examples/java/databases/create-enum-attribute.md index 59cbd46..4420208 100644 --- a/docs/examples/java/databases/create-enum-attribute.md +++ b/docs/examples/java/databases/create-enum-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-float-attribute.md b/docs/examples/java/databases/create-float-attribute.md index cdbdbb2..2263cdb 100644 --- a/docs/examples/java/databases/create-float-attribute.md +++ b/docs/examples/java/databases/create-float-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-index.md b/docs/examples/java/databases/create-index.md index a3f09d4..fe2d9bf 100644 --- a/docs/examples/java/databases/create-index.md +++ b/docs/examples/java/databases/create-index.md @@ -4,7 +4,7 @@ import io.appwrite.services.Databases; import io.appwrite.enums.IndexType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key @@ -17,6 +17,7 @@ databases.createIndex( IndexType.KEY, // type listOf(), // attributes listOf(), // orders (optional) + listOf(), // lengths (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/create-integer-attribute.md b/docs/examples/java/databases/create-integer-attribute.md index 37e7f37..b084e7c 100644 --- a/docs/examples/java/databases/create-integer-attribute.md +++ b/docs/examples/java/databases/create-integer-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-ip-attribute.md b/docs/examples/java/databases/create-ip-attribute.md index bdb0093..ba62dba 100644 --- a/docs/examples/java/databases/create-ip-attribute.md +++ b/docs/examples/java/databases/create-ip-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-relationship-attribute.md b/docs/examples/java/databases/create-relationship-attribute.md index f3d0f51..a67f452 100644 --- a/docs/examples/java/databases/create-relationship-attribute.md +++ b/docs/examples/java/databases/create-relationship-attribute.md @@ -4,7 +4,7 @@ import io.appwrite.services.Databases; import io.appwrite.enums.RelationshipType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-string-attribute.md b/docs/examples/java/databases/create-string-attribute.md index 7d9d8d4..3286c7a 100644 --- a/docs/examples/java/databases/create-string-attribute.md +++ b/docs/examples/java/databases/create-string-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create-url-attribute.md b/docs/examples/java/databases/create-url-attribute.md index 57ed89d..d445d67 100644 --- a/docs/examples/java/databases/create-url-attribute.md +++ b/docs/examples/java/databases/create-url-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/create.md b/docs/examples/java/databases/create.md index 5b66510..31cd37e 100644 --- a/docs/examples/java/databases/create.md +++ b/docs/examples/java/databases/create.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/decrement-document-attribute.md b/docs/examples/java/databases/decrement-document-attribute.md new file mode 100644 index 0000000..a44cc51 --- /dev/null +++ b/docs/examples/java/databases/decrement-document-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.decrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 0, // value (optional) + 0, // min (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/databases/delete-attribute.md b/docs/examples/java/databases/delete-attribute.md index 8f9d2f0..236d492 100644 --- a/docs/examples/java/databases/delete-attribute.md +++ b/docs/examples/java/databases/delete-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/delete-collection.md b/docs/examples/java/databases/delete-collection.md index 334e7ad..5da2a3d 100644 --- a/docs/examples/java/databases/delete-collection.md +++ b/docs/examples/java/databases/delete-collection.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/delete-document.md b/docs/examples/java/databases/delete-document.md index a42b3f1..f6e6209 100644 --- a/docs/examples/java/databases/delete-document.md +++ b/docs/examples/java/databases/delete-document.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/databases/delete-documents.md b/docs/examples/java/databases/delete-documents.md new file mode 100644 index 0000000..e8394b1 --- /dev/null +++ b/docs/examples/java/databases/delete-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteDocuments( + "", // databaseId + "", // collectionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/databases/delete-index.md b/docs/examples/java/databases/delete-index.md index 725045e..6f68435 100644 --- a/docs/examples/java/databases/delete-index.md +++ b/docs/examples/java/databases/delete-index.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/delete.md b/docs/examples/java/databases/delete.md index 41fb72b..b082491 100644 --- a/docs/examples/java/databases/delete.md +++ b/docs/examples/java/databases/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/get-attribute.md b/docs/examples/java/databases/get-attribute.md index 1b29312..672f0b0 100644 --- a/docs/examples/java/databases/get-attribute.md +++ b/docs/examples/java/databases/get-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/get-collection.md b/docs/examples/java/databases/get-collection.md index 41bbb23..59401be 100644 --- a/docs/examples/java/databases/get-collection.md +++ b/docs/examples/java/databases/get-collection.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/get-document.md b/docs/examples/java/databases/get-document.md index 870642b..2719073 100644 --- a/docs/examples/java/databases/get-document.md +++ b/docs/examples/java/databases/get-document.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/databases/get-index.md b/docs/examples/java/databases/get-index.md index eb33b87..61cfe84 100644 --- a/docs/examples/java/databases/get-index.md +++ b/docs/examples/java/databases/get-index.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/get.md b/docs/examples/java/databases/get.md index b276da4..b0e3742 100644 --- a/docs/examples/java/databases/get.md +++ b/docs/examples/java/databases/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/increment-document-attribute.md b/docs/examples/java/databases/increment-document-attribute.md new file mode 100644 index 0000000..b5b5054 --- /dev/null +++ b/docs/examples/java/databases/increment-document-attribute.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.incrementDocumentAttribute( + "", // databaseId + "", // collectionId + "", // documentId + "", // attribute + 0, // value (optional) + 0, // max (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/databases/list-attributes.md b/docs/examples/java/databases/list-attributes.md index 417fe6e..9681831 100644 --- a/docs/examples/java/databases/list-attributes.md +++ b/docs/examples/java/databases/list-attributes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/list-collections.md b/docs/examples/java/databases/list-collections.md index e12e158..3253447 100644 --- a/docs/examples/java/databases/list-collections.md +++ b/docs/examples/java/databases/list-collections.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/list-documents.md b/docs/examples/java/databases/list-documents.md index 4fab62a..36982c0 100644 --- a/docs/examples/java/databases/list-documents.md +++ b/docs/examples/java/databases/list-documents.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/databases/list-indexes.md b/docs/examples/java/databases/list-indexes.md index c266265..8c912bb 100644 --- a/docs/examples/java/databases/list-indexes.md +++ b/docs/examples/java/databases/list-indexes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/list.md b/docs/examples/java/databases/list.md index d014a70..758b9f7 100644 --- a/docs/examples/java/databases/list.md +++ b/docs/examples/java/databases/list.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-boolean-attribute.md b/docs/examples/java/databases/update-boolean-attribute.md index 01a8ba1..3c95851 100644 --- a/docs/examples/java/databases/update-boolean-attribute.md +++ b/docs/examples/java/databases/update-boolean-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-collection.md b/docs/examples/java/databases/update-collection.md index 533d7a7..6805c11 100644 --- a/docs/examples/java/databases/update-collection.md +++ b/docs/examples/java/databases/update-collection.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-datetime-attribute.md b/docs/examples/java/databases/update-datetime-attribute.md index 00b3568..3f451b8 100644 --- a/docs/examples/java/databases/update-datetime-attribute.md +++ b/docs/examples/java/databases/update-datetime-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-document.md b/docs/examples/java/databases/update-document.md index 43c9600..f7b05c9 100644 --- a/docs/examples/java/databases/update-document.md +++ b/docs/examples/java/databases/update-document.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/databases/update-documents.md b/docs/examples/java/databases/update-documents.md new file mode 100644 index 0000000..b4138b4 --- /dev/null +++ b/docs/examples/java/databases/update-documents.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateDocuments( + "", // databaseId + "", // collectionId + mapOf( "a" to "b" ), // data (optional) + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/databases/update-email-attribute.md b/docs/examples/java/databases/update-email-attribute.md index b931370..1ff1221 100644 --- a/docs/examples/java/databases/update-email-attribute.md +++ b/docs/examples/java/databases/update-email-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-enum-attribute.md b/docs/examples/java/databases/update-enum-attribute.md index febf784..8960680 100644 --- a/docs/examples/java/databases/update-enum-attribute.md +++ b/docs/examples/java/databases/update-enum-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-float-attribute.md b/docs/examples/java/databases/update-float-attribute.md index 071bd48..0076987 100644 --- a/docs/examples/java/databases/update-float-attribute.md +++ b/docs/examples/java/databases/update-float-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key @@ -14,9 +14,9 @@ databases.updateFloatAttribute( "", // collectionId "", // key false, // required - 0, // min - 0, // max 0, // default + 0, // min (optional) + 0, // max (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/databases/update-integer-attribute.md b/docs/examples/java/databases/update-integer-attribute.md index b6c1e44..c39af22 100644 --- a/docs/examples/java/databases/update-integer-attribute.md +++ b/docs/examples/java/databases/update-integer-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key @@ -14,9 +14,9 @@ databases.updateIntegerAttribute( "", // collectionId "", // key false, // required - 0, // min - 0, // max 0, // default + 0, // min (optional) + 0, // max (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/databases/update-ip-attribute.md b/docs/examples/java/databases/update-ip-attribute.md index 72b85cf..44b4da2 100644 --- a/docs/examples/java/databases/update-ip-attribute.md +++ b/docs/examples/java/databases/update-ip-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-relationship-attribute.md b/docs/examples/java/databases/update-relationship-attribute.md index 73e2121..8af20e9 100644 --- a/docs/examples/java/databases/update-relationship-attribute.md +++ b/docs/examples/java/databases/update-relationship-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-string-attribute.md b/docs/examples/java/databases/update-string-attribute.md index 2d69006..1f156f3 100644 --- a/docs/examples/java/databases/update-string-attribute.md +++ b/docs/examples/java/databases/update-string-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update-url-attribute.md b/docs/examples/java/databases/update-url-attribute.md index dcfbf30..959054a 100644 --- a/docs/examples/java/databases/update-url-attribute.md +++ b/docs/examples/java/databases/update-url-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/update.md b/docs/examples/java/databases/update.md index f1e6dd3..9928dae 100644 --- a/docs/examples/java/databases/update.md +++ b/docs/examples/java/databases/update.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/databases/upsert-document.md b/docs/examples/java/databases/upsert-document.md new file mode 100644 index 0000000..daa4414 --- /dev/null +++ b/docs/examples/java/databases/upsert-document.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.upsertDocument( + "", // databaseId + "", // collectionId + "", // documentId + mapOf( "a" to "b" ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/databases/upsert-documents.md b/docs/examples/java/databases/upsert-documents.md new file mode 100644 index 0000000..95e9a33 --- /dev/null +++ b/docs/examples/java/databases/upsert-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Databases databases = new Databases(client); + +databases.upsertDocuments( + "", // databaseId + "", // collectionId + listOf(), // documents + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/functions/create-deployment.md b/docs/examples/java/functions/create-deployment.md index 920998e..6e435f4 100644 --- a/docs/examples/java/functions/create-deployment.md +++ b/docs/examples/java/functions/create-deployment.md @@ -4,7 +4,7 @@ import io.appwrite.models.InputFile; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/create-build.md b/docs/examples/java/functions/create-duplicate-deployment.md similarity index 84% rename from docs/examples/java/functions/create-build.md rename to docs/examples/java/functions/create-duplicate-deployment.md index ad55df1..6b9d9a1 100644 --- a/docs/examples/java/functions/create-build.md +++ b/docs/examples/java/functions/create-duplicate-deployment.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Functions functions = new Functions(client); -functions.createBuild( +functions.createDuplicateDeployment( "", // functionId "", // deploymentId "", // buildId (optional) diff --git a/docs/examples/java/functions/create-execution.md b/docs/examples/java/functions/create-execution.md index 62c0634..93efa0a 100644 --- a/docs/examples/java/functions/create-execution.md +++ b/docs/examples/java/functions/create-execution.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with @@ -16,7 +16,7 @@ functions.createExecution( "", // path (optional) ExecutionMethod.GET, // method (optional) mapOf( "a" to "b" ), // headers (optional) - "", // scheduledAt (optional) + "", // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/functions/create-template-deployment.md b/docs/examples/java/functions/create-template-deployment.md new file mode 100644 index 0000000..53b5a9a --- /dev/null +++ b/docs/examples/java/functions/create-template-deployment.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Functions functions = new Functions(client); + +functions.createTemplateDeployment( + "", // functionId + "", // repository + "", // owner + "", // rootDirectory + "", // version + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/functions/create-variable.md b/docs/examples/java/functions/create-variable.md index a1d6c7b..70764fb 100644 --- a/docs/examples/java/functions/create-variable.md +++ b/docs/examples/java/functions/create-variable.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key @@ -13,6 +13,7 @@ functions.createVariable( "", // functionId "", // key "", // value + false, // secret (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/functions/create-vcs-deployment.md b/docs/examples/java/functions/create-vcs-deployment.md new file mode 100644 index 0000000..9274cd8 --- /dev/null +++ b/docs/examples/java/functions/create-vcs-deployment.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Functions; +import io.appwrite.enums.VCSDeploymentType; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Functions functions = new Functions(client); + +functions.createVcsDeployment( + "", // functionId + VCSDeploymentType.BRANCH, // type + "", // reference + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/functions/create.md b/docs/examples/java/functions/create.md index db0cc56..7187128 100644 --- a/docs/examples/java/functions/create.md +++ b/docs/examples/java/functions/create.md @@ -4,7 +4,7 @@ import io.appwrite.services.Functions; import io.appwrite.enums.Runtime; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key @@ -28,10 +28,6 @@ functions.create( "", // providerBranch (optional) false, // providerSilentMode (optional) "", // providerRootDirectory (optional) - "", // templateRepository (optional) - "", // templateOwner (optional) - "", // templateRootDirectory (optional) - "", // templateVersion (optional) "", // specification (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/functions/delete-deployment.md b/docs/examples/java/functions/delete-deployment.md index f115bcc..1a6279f 100644 --- a/docs/examples/java/functions/delete-deployment.md +++ b/docs/examples/java/functions/delete-deployment.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/delete-execution.md b/docs/examples/java/functions/delete-execution.md index 68c11bd..68f81e8 100644 --- a/docs/examples/java/functions/delete-execution.md +++ b/docs/examples/java/functions/delete-execution.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/delete-variable.md b/docs/examples/java/functions/delete-variable.md index ca4d4f4..c881bdc 100644 --- a/docs/examples/java/functions/delete-variable.md +++ b/docs/examples/java/functions/delete-variable.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/delete.md b/docs/examples/java/functions/delete.md index 94c7da5..255fc00 100644 --- a/docs/examples/java/functions/delete.md +++ b/docs/examples/java/functions/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/get-deployment-download.md b/docs/examples/java/functions/get-deployment-download.md index 719d662..d522b12 100644 --- a/docs/examples/java/functions/get-deployment-download.md +++ b/docs/examples/java/functions/get-deployment-download.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key @@ -12,6 +12,7 @@ Functions functions = new Functions(client); functions.getDeploymentDownload( "", // functionId "", // deploymentId + DeploymentDownloadType.SOURCE, // type (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/functions/get-deployment.md b/docs/examples/java/functions/get-deployment.md index f039bee..b300027 100644 --- a/docs/examples/java/functions/get-deployment.md +++ b/docs/examples/java/functions/get-deployment.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/get-execution.md b/docs/examples/java/functions/get-execution.md index 253ff54..76e302f 100644 --- a/docs/examples/java/functions/get-execution.md +++ b/docs/examples/java/functions/get-execution.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/functions/get-variable.md b/docs/examples/java/functions/get-variable.md index 3d01fa4..d54882b 100644 --- a/docs/examples/java/functions/get-variable.md +++ b/docs/examples/java/functions/get-variable.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/get.md b/docs/examples/java/functions/get.md index c22ccca..aa55b93 100644 --- a/docs/examples/java/functions/get.md +++ b/docs/examples/java/functions/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/list-deployments.md b/docs/examples/java/functions/list-deployments.md index 9a1f1ef..16a10ca 100644 --- a/docs/examples/java/functions/list-deployments.md +++ b/docs/examples/java/functions/list-deployments.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/list-executions.md b/docs/examples/java/functions/list-executions.md index f2faa02..25a9af8 100644 --- a/docs/examples/java/functions/list-executions.md +++ b/docs/examples/java/functions/list-executions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with @@ -12,7 +12,6 @@ Functions functions = new Functions(client); functions.listExecutions( "", // functionId listOf(), // queries (optional) - "", // search (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/functions/list-runtimes.md b/docs/examples/java/functions/list-runtimes.md index 156e81f..304a90d 100644 --- a/docs/examples/java/functions/list-runtimes.md +++ b/docs/examples/java/functions/list-runtimes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/list-specifications.md b/docs/examples/java/functions/list-specifications.md index 47d941c..e6c9c09 100644 --- a/docs/examples/java/functions/list-specifications.md +++ b/docs/examples/java/functions/list-specifications.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/list-variables.md b/docs/examples/java/functions/list-variables.md index 1e1e0e7..98c9ff4 100644 --- a/docs/examples/java/functions/list-variables.md +++ b/docs/examples/java/functions/list-variables.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/list.md b/docs/examples/java/functions/list.md index 1c501fd..a9a3206 100644 --- a/docs/examples/java/functions/list.md +++ b/docs/examples/java/functions/list.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/functions/update-deployment-build.md b/docs/examples/java/functions/update-deployment-status.md similarity index 83% rename from docs/examples/java/functions/update-deployment-build.md rename to docs/examples/java/functions/update-deployment-status.md index 62b684f..8755fd9 100644 --- a/docs/examples/java/functions/update-deployment-build.md +++ b/docs/examples/java/functions/update-deployment-status.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Functions functions = new Functions(client); -functions.updateDeploymentBuild( +functions.updateDeploymentStatus( "", // functionId "", // deploymentId new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/functions/update-deployment.md b/docs/examples/java/functions/update-function-deployment.md similarity index 83% rename from docs/examples/java/functions/update-deployment.md rename to docs/examples/java/functions/update-function-deployment.md index 8d28501..b88e87c 100644 --- a/docs/examples/java/functions/update-deployment.md +++ b/docs/examples/java/functions/update-function-deployment.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Functions functions = new Functions(client); -functions.updateDeployment( +functions.updateFunctionDeployment( "", // functionId "", // deploymentId new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/functions/update-variable.md b/docs/examples/java/functions/update-variable.md index 4e0576e..3a2b281 100644 --- a/docs/examples/java/functions/update-variable.md +++ b/docs/examples/java/functions/update-variable.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key @@ -14,6 +14,7 @@ functions.updateVariable( "", // variableId "", // key "", // value (optional) + false, // secret (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/functions/update.md b/docs/examples/java/functions/update.md index c63dfb4..5956c57 100644 --- a/docs/examples/java/functions/update.md +++ b/docs/examples/java/functions/update.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Functions; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/graphql/mutation.md b/docs/examples/java/graphql/mutation.md index a929468..7788924 100644 --- a/docs/examples/java/graphql/mutation.md +++ b/docs/examples/java/graphql/mutation.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Graphql; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/graphql/query.md b/docs/examples/java/graphql/query.md index 8182ea7..e109d52 100644 --- a/docs/examples/java/graphql/query.md +++ b/docs/examples/java/graphql/query.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Graphql; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-antivirus.md b/docs/examples/java/health/get-antivirus.md index 6c1eb15..ca3abf7 100644 --- a/docs/examples/java/health/get-antivirus.md +++ b/docs/examples/java/health/get-antivirus.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-cache.md b/docs/examples/java/health/get-cache.md index 62880c9..24a584c 100644 --- a/docs/examples/java/health/get-cache.md +++ b/docs/examples/java/health/get-cache.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-certificate.md b/docs/examples/java/health/get-certificate.md index 2a60a4c..f4cb5a4 100644 --- a/docs/examples/java/health/get-certificate.md +++ b/docs/examples/java/health/get-certificate.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-d-b.md b/docs/examples/java/health/get-db.md similarity index 85% rename from docs/examples/java/health/get-d-b.md rename to docs/examples/java/health/get-db.md index 703989f..c7a7bef 100644 --- a/docs/examples/java/health/get-d-b.md +++ b/docs/examples/java/health/get-db.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-failed-jobs.md b/docs/examples/java/health/get-failed-jobs.md index 25f53b8..d2b81bd 100644 --- a/docs/examples/java/health/get-failed-jobs.md +++ b/docs/examples/java/health/get-failed-jobs.md @@ -4,7 +4,7 @@ import io.appwrite.services.Health; import io.appwrite.enums.Name; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-pub-sub.md b/docs/examples/java/health/get-pub-sub.md index 116da6f..70210c4 100644 --- a/docs/examples/java/health/get-pub-sub.md +++ b/docs/examples/java/health/get-pub-sub.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-builds.md b/docs/examples/java/health/get-queue-builds.md index a80a745..2ca5d7f 100644 --- a/docs/examples/java/health/get-queue-builds.md +++ b/docs/examples/java/health/get-queue-builds.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-certificates.md b/docs/examples/java/health/get-queue-certificates.md index ee0d48e..519817a 100644 --- a/docs/examples/java/health/get-queue-certificates.md +++ b/docs/examples/java/health/get-queue-certificates.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-databases.md b/docs/examples/java/health/get-queue-databases.md index 7f34b19..2f17566 100644 --- a/docs/examples/java/health/get-queue-databases.md +++ b/docs/examples/java/health/get-queue-databases.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-deletes.md b/docs/examples/java/health/get-queue-deletes.md index 23ed2af..e65aa9a 100644 --- a/docs/examples/java/health/get-queue-deletes.md +++ b/docs/examples/java/health/get-queue-deletes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-functions.md b/docs/examples/java/health/get-queue-functions.md index 2fcfb8b..720f114 100644 --- a/docs/examples/java/health/get-queue-functions.md +++ b/docs/examples/java/health/get-queue-functions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-logs.md b/docs/examples/java/health/get-queue-logs.md index bcf6da2..09b0de4 100644 --- a/docs/examples/java/health/get-queue-logs.md +++ b/docs/examples/java/health/get-queue-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-mails.md b/docs/examples/java/health/get-queue-mails.md index 7580db6..b1ae357 100644 --- a/docs/examples/java/health/get-queue-mails.md +++ b/docs/examples/java/health/get-queue-mails.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-messaging.md b/docs/examples/java/health/get-queue-messaging.md index 7b927d0..61c0b8c 100644 --- a/docs/examples/java/health/get-queue-messaging.md +++ b/docs/examples/java/health/get-queue-messaging.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-migrations.md b/docs/examples/java/health/get-queue-migrations.md index c1a9fad..0e7d669 100644 --- a/docs/examples/java/health/get-queue-migrations.md +++ b/docs/examples/java/health/get-queue-migrations.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-usage-dump.md b/docs/examples/java/health/get-queue-stats-resources.md similarity index 82% rename from docs/examples/java/health/get-queue-usage-dump.md rename to docs/examples/java/health/get-queue-stats-resources.md index 59bd406..e2f8062 100644 --- a/docs/examples/java/health/get-queue-usage-dump.md +++ b/docs/examples/java/health/get-queue-stats-resources.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Health health = new Health(client); -health.getQueueUsageDump( +health.getQueueStatsResources( 0, // threshold (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/health/get-queue-usage.md b/docs/examples/java/health/get-queue-usage.md index 360567a..bfda61a 100644 --- a/docs/examples/java/health/get-queue-usage.md +++ b/docs/examples/java/health/get-queue-usage.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-queue-webhooks.md b/docs/examples/java/health/get-queue-webhooks.md index 180c0cc..d9aed66 100644 --- a/docs/examples/java/health/get-queue-webhooks.md +++ b/docs/examples/java/health/get-queue-webhooks.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-storage-local.md b/docs/examples/java/health/get-storage-local.md index 99c7513..65367cc 100644 --- a/docs/examples/java/health/get-storage-local.md +++ b/docs/examples/java/health/get-storage-local.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-storage.md b/docs/examples/java/health/get-storage.md index 9bd63ca..3a0f0f8 100644 --- a/docs/examples/java/health/get-storage.md +++ b/docs/examples/java/health/get-storage.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get-time.md b/docs/examples/java/health/get-time.md index 89ec655..f0ba668 100644 --- a/docs/examples/java/health/get-time.md +++ b/docs/examples/java/health/get-time.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/health/get.md b/docs/examples/java/health/get.md index e81254e..87a7c0a 100644 --- a/docs/examples/java/health/get.md +++ b/docs/examples/java/health/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Health; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/locale/get.md b/docs/examples/java/locale/get.md index 8063ce1..2d5e0ac 100644 --- a/docs/examples/java/locale/get.md +++ b/docs/examples/java/locale/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/locale/list-codes.md b/docs/examples/java/locale/list-codes.md index 4bc244a..9f07d1d 100644 --- a/docs/examples/java/locale/list-codes.md +++ b/docs/examples/java/locale/list-codes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/locale/list-continents.md b/docs/examples/java/locale/list-continents.md index 03b9122..5d9e4b0 100644 --- a/docs/examples/java/locale/list-continents.md +++ b/docs/examples/java/locale/list-continents.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/locale/list-countries-e-u.md b/docs/examples/java/locale/list-countries-eu.md similarity index 85% rename from docs/examples/java/locale/list-countries-e-u.md rename to docs/examples/java/locale/list-countries-eu.md index 9a6ee54..232a0ef 100644 --- a/docs/examples/java/locale/list-countries-e-u.md +++ b/docs/examples/java/locale/list-countries-eu.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/locale/list-countries-phones.md b/docs/examples/java/locale/list-countries-phones.md index cfab3be..a4739a5 100644 --- a/docs/examples/java/locale/list-countries-phones.md +++ b/docs/examples/java/locale/list-countries-phones.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/locale/list-countries.md b/docs/examples/java/locale/list-countries.md index 079a839..5b8f250 100644 --- a/docs/examples/java/locale/list-countries.md +++ b/docs/examples/java/locale/list-countries.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/locale/list-currencies.md b/docs/examples/java/locale/list-currencies.md index bab723f..adf1d78 100644 --- a/docs/examples/java/locale/list-currencies.md +++ b/docs/examples/java/locale/list-currencies.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/locale/list-languages.md b/docs/examples/java/locale/list-languages.md index b0435b7..c92ea52 100644 --- a/docs/examples/java/locale/list-languages.md +++ b/docs/examples/java/locale/list-languages.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/messaging/create-apns-provider.md b/docs/examples/java/messaging/create-apns-provider.md index 5dde983..acae476 100644 --- a/docs/examples/java/messaging/create-apns-provider.md +++ b/docs/examples/java/messaging/create-apns-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Messaging messaging = new Messaging(client); -messaging.createApnsProvider( +messaging.createAPNSProvider( "", // providerId "", // name "", // authKey (optional) diff --git a/docs/examples/java/messaging/create-email.md b/docs/examples/java/messaging/create-email.md index 753a89b..d6ab5ee 100644 --- a/docs/examples/java/messaging/create-email.md +++ b/docs/examples/java/messaging/create-email.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-fcm-provider.md b/docs/examples/java/messaging/create-fcm-provider.md index 1078514..0d67e28 100644 --- a/docs/examples/java/messaging/create-fcm-provider.md +++ b/docs/examples/java/messaging/create-fcm-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Messaging messaging = new Messaging(client); -messaging.createFcmProvider( +messaging.createFCMProvider( "", // providerId "", // name mapOf( "a" to "b" ), // serviceAccountJSON (optional) diff --git a/docs/examples/java/messaging/create-mailgun-provider.md b/docs/examples/java/messaging/create-mailgun-provider.md index 4b2a7bd..272f9d2 100644 --- a/docs/examples/java/messaging/create-mailgun-provider.md +++ b/docs/examples/java/messaging/create-mailgun-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-msg91provider.md b/docs/examples/java/messaging/create-msg-91-provider.md similarity index 90% rename from docs/examples/java/messaging/create-msg91provider.md rename to docs/examples/java/messaging/create-msg-91-provider.md index 6cc120c..2100529 100644 --- a/docs/examples/java/messaging/create-msg91provider.md +++ b/docs/examples/java/messaging/create-msg-91-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-push.md b/docs/examples/java/messaging/create-push.md index 56c7a60..277ab96 100644 --- a/docs/examples/java/messaging/create-push.md +++ b/docs/examples/java/messaging/create-push.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-sendgrid-provider.md b/docs/examples/java/messaging/create-sendgrid-provider.md index 20e1274..84c5bf4 100644 --- a/docs/examples/java/messaging/create-sendgrid-provider.md +++ b/docs/examples/java/messaging/create-sendgrid-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-sms.md b/docs/examples/java/messaging/create-sms.md index 60e1749..ca40cc3 100644 --- a/docs/examples/java/messaging/create-sms.md +++ b/docs/examples/java/messaging/create-sms.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Messaging messaging = new Messaging(client); -messaging.createSms( +messaging.createSMS( "", // messageId "", // content listOf(), // topics (optional) diff --git a/docs/examples/java/messaging/create-smtp-provider.md b/docs/examples/java/messaging/create-smtp-provider.md index 3f69f61..1f1a0f9 100644 --- a/docs/examples/java/messaging/create-smtp-provider.md +++ b/docs/examples/java/messaging/create-smtp-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Messaging messaging = new Messaging(client); -messaging.createSmtpProvider( +messaging.createSMTPProvider( "", // providerId "", // name "", // host diff --git a/docs/examples/java/messaging/create-subscriber.md b/docs/examples/java/messaging/create-subscriber.md index 77ef2d5..1ccb8fe 100644 --- a/docs/examples/java/messaging/create-subscriber.md +++ b/docs/examples/java/messaging/create-subscriber.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setJWT(""); // Your secret JSON Web Token diff --git a/docs/examples/java/messaging/create-telesign-provider.md b/docs/examples/java/messaging/create-telesign-provider.md index f660814..6b64499 100644 --- a/docs/examples/java/messaging/create-telesign-provider.md +++ b/docs/examples/java/messaging/create-telesign-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-textmagic-provider.md b/docs/examples/java/messaging/create-textmagic-provider.md index cda11d5..477d7d8 100644 --- a/docs/examples/java/messaging/create-textmagic-provider.md +++ b/docs/examples/java/messaging/create-textmagic-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-topic.md b/docs/examples/java/messaging/create-topic.md index 8fa74d8..63a24b4 100644 --- a/docs/examples/java/messaging/create-topic.md +++ b/docs/examples/java/messaging/create-topic.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-twilio-provider.md b/docs/examples/java/messaging/create-twilio-provider.md index a122837..8d1b4da 100644 --- a/docs/examples/java/messaging/create-twilio-provider.md +++ b/docs/examples/java/messaging/create-twilio-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/create-vonage-provider.md b/docs/examples/java/messaging/create-vonage-provider.md index 808ca0c..db1e476 100644 --- a/docs/examples/java/messaging/create-vonage-provider.md +++ b/docs/examples/java/messaging/create-vonage-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/delete-provider.md b/docs/examples/java/messaging/delete-provider.md index e1337dc..b0fa837 100644 --- a/docs/examples/java/messaging/delete-provider.md +++ b/docs/examples/java/messaging/delete-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/delete-subscriber.md b/docs/examples/java/messaging/delete-subscriber.md index c80fc72..a3635b9 100644 --- a/docs/examples/java/messaging/delete-subscriber.md +++ b/docs/examples/java/messaging/delete-subscriber.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setJWT(""); // Your secret JSON Web Token diff --git a/docs/examples/java/messaging/delete-topic.md b/docs/examples/java/messaging/delete-topic.md index 9c51144..7b598b2 100644 --- a/docs/examples/java/messaging/delete-topic.md +++ b/docs/examples/java/messaging/delete-topic.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/delete.md b/docs/examples/java/messaging/delete.md index f90336a..1395a39 100644 --- a/docs/examples/java/messaging/delete.md +++ b/docs/examples/java/messaging/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/get-message.md b/docs/examples/java/messaging/get-message.md index 5e940cf..3860ff2 100644 --- a/docs/examples/java/messaging/get-message.md +++ b/docs/examples/java/messaging/get-message.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/get-provider.md b/docs/examples/java/messaging/get-provider.md index 74ece13..9717b90 100644 --- a/docs/examples/java/messaging/get-provider.md +++ b/docs/examples/java/messaging/get-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/get-subscriber.md b/docs/examples/java/messaging/get-subscriber.md index 2e6beaa..641a494 100644 --- a/docs/examples/java/messaging/get-subscriber.md +++ b/docs/examples/java/messaging/get-subscriber.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/get-topic.md b/docs/examples/java/messaging/get-topic.md index adf64bb..c9f2eff 100644 --- a/docs/examples/java/messaging/get-topic.md +++ b/docs/examples/java/messaging/get-topic.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-message-logs.md b/docs/examples/java/messaging/list-message-logs.md index 70bb49a..0f94e46 100644 --- a/docs/examples/java/messaging/list-message-logs.md +++ b/docs/examples/java/messaging/list-message-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-messages.md b/docs/examples/java/messaging/list-messages.md index 847ce73..006ba7c 100644 --- a/docs/examples/java/messaging/list-messages.md +++ b/docs/examples/java/messaging/list-messages.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-provider-logs.md b/docs/examples/java/messaging/list-provider-logs.md index be1aba0..5f77f2d 100644 --- a/docs/examples/java/messaging/list-provider-logs.md +++ b/docs/examples/java/messaging/list-provider-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-providers.md b/docs/examples/java/messaging/list-providers.md index feda900..b069dda 100644 --- a/docs/examples/java/messaging/list-providers.md +++ b/docs/examples/java/messaging/list-providers.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-subscriber-logs.md b/docs/examples/java/messaging/list-subscriber-logs.md index 30250e4..b10e446 100644 --- a/docs/examples/java/messaging/list-subscriber-logs.md +++ b/docs/examples/java/messaging/list-subscriber-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-subscribers.md b/docs/examples/java/messaging/list-subscribers.md index d00d492..52ca5b0 100644 --- a/docs/examples/java/messaging/list-subscribers.md +++ b/docs/examples/java/messaging/list-subscribers.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-targets.md b/docs/examples/java/messaging/list-targets.md index f1eeac0..5b9f40e 100644 --- a/docs/examples/java/messaging/list-targets.md +++ b/docs/examples/java/messaging/list-targets.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-topic-logs.md b/docs/examples/java/messaging/list-topic-logs.md index c7edc92..b2e9444 100644 --- a/docs/examples/java/messaging/list-topic-logs.md +++ b/docs/examples/java/messaging/list-topic-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/list-topics.md b/docs/examples/java/messaging/list-topics.md index 278d0d4..e6408a6 100644 --- a/docs/examples/java/messaging/list-topics.md +++ b/docs/examples/java/messaging/list-topics.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-apns-provider.md b/docs/examples/java/messaging/update-apns-provider.md index b9ac1a9..c5da5ba 100644 --- a/docs/examples/java/messaging/update-apns-provider.md +++ b/docs/examples/java/messaging/update-apns-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Messaging messaging = new Messaging(client); -messaging.updateApnsProvider( +messaging.updateAPNSProvider( "", // providerId "", // name (optional) false, // enabled (optional) diff --git a/docs/examples/java/messaging/update-email.md b/docs/examples/java/messaging/update-email.md index a5d9820..56e9767 100644 --- a/docs/examples/java/messaging/update-email.md +++ b/docs/examples/java/messaging/update-email.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-fcm-provider.md b/docs/examples/java/messaging/update-fcm-provider.md index 956900d..dd92f93 100644 --- a/docs/examples/java/messaging/update-fcm-provider.md +++ b/docs/examples/java/messaging/update-fcm-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Messaging messaging = new Messaging(client); -messaging.updateFcmProvider( +messaging.updateFCMProvider( "", // providerId "", // name (optional) false, // enabled (optional) diff --git a/docs/examples/java/messaging/update-mailgun-provider.md b/docs/examples/java/messaging/update-mailgun-provider.md index 8512de1..5547ae8 100644 --- a/docs/examples/java/messaging/update-mailgun-provider.md +++ b/docs/examples/java/messaging/update-mailgun-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-msg91provider.md b/docs/examples/java/messaging/update-msg-91-provider.md similarity index 90% rename from docs/examples/java/messaging/update-msg91provider.md rename to docs/examples/java/messaging/update-msg-91-provider.md index 74de7d2..d8e4856 100644 --- a/docs/examples/java/messaging/update-msg91provider.md +++ b/docs/examples/java/messaging/update-msg-91-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-push.md b/docs/examples/java/messaging/update-push.md index bb8c3c8..b7038de 100644 --- a/docs/examples/java/messaging/update-push.md +++ b/docs/examples/java/messaging/update-push.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-sendgrid-provider.md b/docs/examples/java/messaging/update-sendgrid-provider.md index 79c89c0..14a4e99 100644 --- a/docs/examples/java/messaging/update-sendgrid-provider.md +++ b/docs/examples/java/messaging/update-sendgrid-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-sms.md b/docs/examples/java/messaging/update-sms.md index bfca7d3..c59505b 100644 --- a/docs/examples/java/messaging/update-sms.md +++ b/docs/examples/java/messaging/update-sms.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Messaging messaging = new Messaging(client); -messaging.updateSms( +messaging.updateSMS( "", // messageId listOf(), // topics (optional) listOf(), // users (optional) diff --git a/docs/examples/java/messaging/update-smtp-provider.md b/docs/examples/java/messaging/update-smtp-provider.md index e308381..36f1200 100644 --- a/docs/examples/java/messaging/update-smtp-provider.md +++ b/docs/examples/java/messaging/update-smtp-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Messaging messaging = new Messaging(client); -messaging.updateSmtpProvider( +messaging.updateSMTPProvider( "", // providerId "", // name (optional) "", // host (optional) diff --git a/docs/examples/java/messaging/update-telesign-provider.md b/docs/examples/java/messaging/update-telesign-provider.md index 6ffb534..8181bf1 100644 --- a/docs/examples/java/messaging/update-telesign-provider.md +++ b/docs/examples/java/messaging/update-telesign-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-textmagic-provider.md b/docs/examples/java/messaging/update-textmagic-provider.md index d80b5ae..bc156b7 100644 --- a/docs/examples/java/messaging/update-textmagic-provider.md +++ b/docs/examples/java/messaging/update-textmagic-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-topic.md b/docs/examples/java/messaging/update-topic.md index 1013fba..be9c44d 100644 --- a/docs/examples/java/messaging/update-topic.md +++ b/docs/examples/java/messaging/update-topic.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-twilio-provider.md b/docs/examples/java/messaging/update-twilio-provider.md index 65fb0fc..ed58ee9 100644 --- a/docs/examples/java/messaging/update-twilio-provider.md +++ b/docs/examples/java/messaging/update-twilio-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/messaging/update-vonage-provider.md b/docs/examples/java/messaging/update-vonage-provider.md index 6548d17..d5bfe36 100644 --- a/docs/examples/java/messaging/update-vonage-provider.md +++ b/docs/examples/java/messaging/update-vonage-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/sites/create-deployment.md b/docs/examples/java/sites/create-deployment.md new file mode 100644 index 0000000..f370f80 --- /dev/null +++ b/docs/examples/java/sites/create-deployment.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.models.InputFile; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.createDeployment( + "", // siteId + InputFile.fromPath("file.png"), // code + false, // activate + "", // installCommand (optional) + "", // buildCommand (optional) + "", // outputDirectory (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/create-duplicate-deployment.md b/docs/examples/java/sites/create-duplicate-deployment.md new file mode 100644 index 0000000..35e43b8 --- /dev/null +++ b/docs/examples/java/sites/create-duplicate-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.createDuplicateDeployment( + "", // siteId + "", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/create-template-deployment.md b/docs/examples/java/sites/create-template-deployment.md new file mode 100644 index 0000000..63aba4a --- /dev/null +++ b/docs/examples/java/sites/create-template-deployment.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.createTemplateDeployment( + "", // siteId + "", // repository + "", // owner + "", // rootDirectory + "", // version + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/create-variable.md b/docs/examples/java/sites/create-variable.md new file mode 100644 index 0000000..c77bec3 --- /dev/null +++ b/docs/examples/java/sites/create-variable.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.createVariable( + "", // siteId + "", // key + "", // value + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/create-vcs-deployment.md b/docs/examples/java/sites/create-vcs-deployment.md new file mode 100644 index 0000000..754eb26 --- /dev/null +++ b/docs/examples/java/sites/create-vcs-deployment.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.VCSDeploymentType; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.createVcsDeployment( + "", // siteId + VCSDeploymentType.BRANCH, // type + "", // reference + false, // activate (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/create.md b/docs/examples/java/sites/create.md new file mode 100644 index 0000000..19664ec --- /dev/null +++ b/docs/examples/java/sites/create.md @@ -0,0 +1,42 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.Framework; +import io.appwrite.enums.BuildRuntime; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.create( + "", // siteId + "", // name + .ANALOG, // framework + .NODE_14_5, // buildRuntime + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + "", // installCommand (optional) + "", // buildCommand (optional) + "", // outputDirectory (optional) + .STATIC, // adapter (optional) + "", // installationId (optional) + "", // fallbackFile (optional) + "", // providerRepositoryId (optional) + "", // providerBranch (optional) + false, // providerSilentMode (optional) + "", // providerRootDirectory (optional) + "", // specification (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/delete-deployment.md b/docs/examples/java/sites/delete-deployment.md new file mode 100644 index 0000000..97c08ab --- /dev/null +++ b/docs/examples/java/sites/delete-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteDeployment( + "", // siteId + "", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/delete-log.md b/docs/examples/java/sites/delete-log.md new file mode 100644 index 0000000..d718937 --- /dev/null +++ b/docs/examples/java/sites/delete-log.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteLog( + "", // siteId + "", // logId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/delete-variable.md b/docs/examples/java/sites/delete-variable.md new file mode 100644 index 0000000..4e2b3ab --- /dev/null +++ b/docs/examples/java/sites/delete-variable.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.deleteVariable( + "", // siteId + "", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/delete.md b/docs/examples/java/sites/delete.md new file mode 100644 index 0000000..fd07bb2 --- /dev/null +++ b/docs/examples/java/sites/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.delete( + "", // siteId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/get-deployment-download.md b/docs/examples/java/sites/get-deployment-download.md new file mode 100644 index 0000000..5875c72 --- /dev/null +++ b/docs/examples/java/sites/get-deployment-download.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.getDeploymentDownload( + "", // siteId + "", // deploymentId + DeploymentDownloadType.SOURCE, // type (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/get-deployment.md b/docs/examples/java/sites/get-deployment.md new file mode 100644 index 0000000..6af859b --- /dev/null +++ b/docs/examples/java/sites/get-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.getDeployment( + "", // siteId + "", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/get-log.md b/docs/examples/java/sites/get-log.md new file mode 100644 index 0000000..d33f2a6 --- /dev/null +++ b/docs/examples/java/sites/get-log.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.getLog( + "", // siteId + "", // logId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/get-variable.md b/docs/examples/java/sites/get-variable.md new file mode 100644 index 0000000..1c8df0c --- /dev/null +++ b/docs/examples/java/sites/get-variable.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.getVariable( + "", // siteId + "", // variableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/get.md b/docs/examples/java/sites/get.md new file mode 100644 index 0000000..660cad3 --- /dev/null +++ b/docs/examples/java/sites/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.get( + "", // siteId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/list-deployments.md b/docs/examples/java/sites/list-deployments.md new file mode 100644 index 0000000..8bcec54 --- /dev/null +++ b/docs/examples/java/sites/list-deployments.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.listDeployments( + "", // siteId + listOf(), // queries (optional) + "", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/health/get-queue.md b/docs/examples/java/sites/list-frameworks.md similarity index 61% rename from docs/examples/java/health/get-queue.md rename to docs/examples/java/sites/list-frameworks.md index 55937b7..df59717 100644 --- a/docs/examples/java/health/get-queue.md +++ b/docs/examples/java/sites/list-frameworks.md @@ -1,15 +1,15 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Health; +import io.appwrite.services.Sites; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key -Health health = new Health(client); +Sites sites = new Sites(client); -health.getQueue(new CoroutineCallback<>((result, error) -> { +sites.listFrameworks(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; diff --git a/docs/examples/java/sites/list-logs.md b/docs/examples/java/sites/list-logs.md new file mode 100644 index 0000000..3532882 --- /dev/null +++ b/docs/examples/java/sites/list-logs.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.listLogs( + "", // siteId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/list-specifications.md b/docs/examples/java/sites/list-specifications.md new file mode 100644 index 0000000..caad732 --- /dev/null +++ b/docs/examples/java/sites/list-specifications.md @@ -0,0 +1,19 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.listSpecifications(new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); +})); diff --git a/docs/examples/java/sites/list-variables.md b/docs/examples/java/sites/list-variables.md new file mode 100644 index 0000000..f2a38b7 --- /dev/null +++ b/docs/examples/java/sites/list-variables.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.listVariables( + "", // siteId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/list.md b/docs/examples/java/sites/list.md new file mode 100644 index 0000000..39a1c06 --- /dev/null +++ b/docs/examples/java/sites/list.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.list( + listOf(), // queries (optional) + "", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/update-deployment-status.md b/docs/examples/java/sites/update-deployment-status.md new file mode 100644 index 0000000..8dc3041 --- /dev/null +++ b/docs/examples/java/sites/update-deployment-status.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateDeploymentStatus( + "", // siteId + "", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/update-site-deployment.md b/docs/examples/java/sites/update-site-deployment.md new file mode 100644 index 0000000..edbda7c --- /dev/null +++ b/docs/examples/java/sites/update-site-deployment.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateSiteDeployment( + "", // siteId + "", // deploymentId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/update-variable.md b/docs/examples/java/sites/update-variable.md new file mode 100644 index 0000000..9735ae3 --- /dev/null +++ b/docs/examples/java/sites/update-variable.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.updateVariable( + "", // siteId + "", // variableId + "", // key + "", // value (optional) + false, // secret (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/update.md b/docs/examples/java/sites/update.md new file mode 100644 index 0000000..9a8b577 --- /dev/null +++ b/docs/examples/java/sites/update.md @@ -0,0 +1,41 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Sites; +import io.appwrite.enums.Framework; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Sites sites = new Sites(client); + +sites.update( + "", // siteId + "", // name + .ANALOG, // framework + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + "", // installCommand (optional) + "", // buildCommand (optional) + "", // outputDirectory (optional) + .NODE_14_5, // buildRuntime (optional) + .STATIC, // adapter (optional) + "", // fallbackFile (optional) + "", // installationId (optional) + "", // providerRepositoryId (optional) + "", // providerBranch (optional) + false, // providerSilentMode (optional) + "", // providerRootDirectory (optional) + "", // specification (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/storage/create-bucket.md b/docs/examples/java/storage/create-bucket.md index ccb9961..a3a3308 100644 --- a/docs/examples/java/storage/create-bucket.md +++ b/docs/examples/java/storage/create-bucket.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/storage/create-file.md b/docs/examples/java/storage/create-file.md index 92907fc..583f856 100644 --- a/docs/examples/java/storage/create-file.md +++ b/docs/examples/java/storage/create-file.md @@ -4,7 +4,7 @@ import io.appwrite.models.InputFile; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/storage/delete-bucket.md b/docs/examples/java/storage/delete-bucket.md index 8c46ba9..eb77754 100644 --- a/docs/examples/java/storage/delete-bucket.md +++ b/docs/examples/java/storage/delete-bucket.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/storage/delete-file.md b/docs/examples/java/storage/delete-file.md index 01d423d..8976fd1 100644 --- a/docs/examples/java/storage/delete-file.md +++ b/docs/examples/java/storage/delete-file.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/storage/get-bucket.md b/docs/examples/java/storage/get-bucket.md index 63c847f..a099f33 100644 --- a/docs/examples/java/storage/get-bucket.md +++ b/docs/examples/java/storage/get-bucket.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/storage/get-file-download.md b/docs/examples/java/storage/get-file-download.md index 32bff0b..edda260 100644 --- a/docs/examples/java/storage/get-file-download.md +++ b/docs/examples/java/storage/get-file-download.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with @@ -12,6 +12,7 @@ Storage storage = new Storage(client); storage.getFileDownload( "", // bucketId "", // fileId + "", // token (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/storage/get-file-preview.md b/docs/examples/java/storage/get-file-preview.md index 650ea4d..1a0ab59 100644 --- a/docs/examples/java/storage/get-file-preview.md +++ b/docs/examples/java/storage/get-file-preview.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with @@ -15,7 +15,7 @@ storage.getFilePreview( 0, // width (optional) 0, // height (optional) ImageGravity.CENTER, // gravity (optional) - 0, // quality (optional) + -1, // quality (optional) 0, // borderWidth (optional) "", // borderColor (optional) 0, // borderRadius (optional) @@ -23,6 +23,7 @@ storage.getFilePreview( -360, // rotation (optional) "", // background (optional) ImageFormat.JPG, // output (optional) + "", // token (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/storage/get-file-view.md b/docs/examples/java/storage/get-file-view.md index 5a81eba..178e507 100644 --- a/docs/examples/java/storage/get-file-view.md +++ b/docs/examples/java/storage/get-file-view.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with @@ -12,6 +12,7 @@ Storage storage = new Storage(client); storage.getFileView( "", // bucketId "", // fileId + "", // token (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/storage/get-file.md b/docs/examples/java/storage/get-file.md index 004dc01..7a04c80 100644 --- a/docs/examples/java/storage/get-file.md +++ b/docs/examples/java/storage/get-file.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/storage/list-buckets.md b/docs/examples/java/storage/list-buckets.md index 8ab56e3..9d85957 100644 --- a/docs/examples/java/storage/list-buckets.md +++ b/docs/examples/java/storage/list-buckets.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/storage/list-files.md b/docs/examples/java/storage/list-files.md index 6fbd2c3..f002754 100644 --- a/docs/examples/java/storage/list-files.md +++ b/docs/examples/java/storage/list-files.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/storage/update-bucket.md b/docs/examples/java/storage/update-bucket.md index 342174e..2d80e26 100644 --- a/docs/examples/java/storage/update-bucket.md +++ b/docs/examples/java/storage/update-bucket.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/storage/update-file.md b/docs/examples/java/storage/update-file.md index 3578bcd..7f325f9 100644 --- a/docs/examples/java/storage/update-file.md +++ b/docs/examples/java/storage/update-file.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/tablesdb/create-boolean-column.md b/docs/examples/java/tablesdb/create-boolean-column.md new file mode 100644 index 0000000..14a96a1 --- /dev/null +++ b/docs/examples/java/tablesdb/create-boolean-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createBooleanColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + false, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-datetime-column.md b/docs/examples/java/tablesdb/create-datetime-column.md new file mode 100644 index 0000000..6dd28b3 --- /dev/null +++ b/docs/examples/java/tablesdb/create-datetime-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createDatetimeColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-email-column.md b/docs/examples/java/tablesdb/create-email-column.md new file mode 100644 index 0000000..e9f3d36 --- /dev/null +++ b/docs/examples/java/tablesdb/create-email-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createEmailColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "email@example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-enum-column.md b/docs/examples/java/tablesdb/create-enum-column.md new file mode 100644 index 0000000..bc31bbe --- /dev/null +++ b/docs/examples/java/tablesdb/create-enum-column.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createEnumColumn( + "", // databaseId + "", // tableId + "", // key + listOf(), // elements + false, // required + "", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-float-column.md b/docs/examples/java/tablesdb/create-float-column.md new file mode 100644 index 0000000..51312d0 --- /dev/null +++ b/docs/examples/java/tablesdb/create-float-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createFloatColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + 0, // min (optional) + 0, // max (optional) + 0, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-index.md b/docs/examples/java/tablesdb/create-index.md new file mode 100644 index 0000000..991bd34 --- /dev/null +++ b/docs/examples/java/tablesdb/create-index.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; +import io.appwrite.enums.IndexType; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIndex( + "", // databaseId + "", // tableId + "", // key + IndexType.KEY, // type + listOf(), // columns + listOf(), // orders (optional) + listOf(), // lengths (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-integer-column.md b/docs/examples/java/tablesdb/create-integer-column.md new file mode 100644 index 0000000..1e0a363 --- /dev/null +++ b/docs/examples/java/tablesdb/create-integer-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIntegerColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + 0, // min (optional) + 0, // max (optional) + 0, // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-ip-column.md b/docs/examples/java/tablesdb/create-ip-column.md new file mode 100644 index 0000000..a963cc1 --- /dev/null +++ b/docs/examples/java/tablesdb/create-ip-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createIpColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-relationship-column.md b/docs/examples/java/tablesdb/create-relationship-column.md new file mode 100644 index 0000000..956c1fa --- /dev/null +++ b/docs/examples/java/tablesdb/create-relationship-column.md @@ -0,0 +1,31 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; +import io.appwrite.enums.RelationshipType; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRelationshipColumn( + "", // databaseId + "", // tableId + "", // relatedTableId + RelationshipType.ONETOONE, // type + false, // twoWay (optional) + "", // key (optional) + "", // twoWayKey (optional) + RelationMutate.CASCADE, // onDelete (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-row.md b/docs/examples/java/tablesdb/create-row.md new file mode 100644 index 0000000..4145022 --- /dev/null +++ b/docs/examples/java/tablesdb/create-row.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRow( + "", // databaseId + "", // tableId + "", // rowId + mapOf( "a" to "b" ), // data + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-rows.md b/docs/examples/java/tablesdb/create-rows.md new file mode 100644 index 0000000..21bdd21 --- /dev/null +++ b/docs/examples/java/tablesdb/create-rows.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createRows( + "", // databaseId + "", // tableId + listOf(), // rows + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-string-column.md b/docs/examples/java/tablesdb/create-string-column.md new file mode 100644 index 0000000..3596340 --- /dev/null +++ b/docs/examples/java/tablesdb/create-string-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createStringColumn( + "", // databaseId + "", // tableId + "", // key + 1, // size + false, // required + "", // default (optional) + false, // array (optional) + false, // encrypt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-table.md b/docs/examples/java/tablesdb/create-table.md new file mode 100644 index 0000000..5bd3b6d --- /dev/null +++ b/docs/examples/java/tablesdb/create-table.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createTable( + "", // databaseId + "", // tableId + "", // name + listOf("read("any")"), // permissions (optional) + false, // rowSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create-url-column.md b/docs/examples/java/tablesdb/create-url-column.md new file mode 100644 index 0000000..20c10e6 --- /dev/null +++ b/docs/examples/java/tablesdb/create-url-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.createUrlColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "https://example.com", // default (optional) + false, // array (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/create.md b/docs/examples/java/tablesdb/create.md new file mode 100644 index 0000000..112e8e6 --- /dev/null +++ b/docs/examples/java/tablesdb/create.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.create( + "", // databaseId + "", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/decrement-row-column.md b/docs/examples/java/tablesdb/decrement-row-column.md new file mode 100644 index 0000000..b9f250f --- /dev/null +++ b/docs/examples/java/tablesdb/decrement-row-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.decrementRowColumn( + "", // databaseId + "", // tableId + "", // rowId + "", // column + 0, // value (optional) + 0, // min (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/delete-column.md b/docs/examples/java/tablesdb/delete-column.md new file mode 100644 index 0000000..25d94d2 --- /dev/null +++ b/docs/examples/java/tablesdb/delete-column.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteColumn( + "", // databaseId + "", // tableId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/delete-index.md b/docs/examples/java/tablesdb/delete-index.md new file mode 100644 index 0000000..aa40dd0 --- /dev/null +++ b/docs/examples/java/tablesdb/delete-index.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteIndex( + "", // databaseId + "", // tableId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/delete-row.md b/docs/examples/java/tablesdb/delete-row.md new file mode 100644 index 0000000..fd66525 --- /dev/null +++ b/docs/examples/java/tablesdb/delete-row.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteRow( + "", // databaseId + "", // tableId + "", // rowId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/delete-rows.md b/docs/examples/java/tablesdb/delete-rows.md new file mode 100644 index 0000000..43b772e --- /dev/null +++ b/docs/examples/java/tablesdb/delete-rows.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteRows( + "", // databaseId + "", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/delete-table.md b/docs/examples/java/tablesdb/delete-table.md new file mode 100644 index 0000000..dcd6daa --- /dev/null +++ b/docs/examples/java/tablesdb/delete-table.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.deleteTable( + "", // databaseId + "", // tableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/delete.md b/docs/examples/java/tablesdb/delete.md new file mode 100644 index 0000000..ea30c34 --- /dev/null +++ b/docs/examples/java/tablesdb/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.delete( + "", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/get-column.md b/docs/examples/java/tablesdb/get-column.md new file mode 100644 index 0000000..42ed776 --- /dev/null +++ b/docs/examples/java/tablesdb/get-column.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getColumn( + "", // databaseId + "", // tableId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/get-index.md b/docs/examples/java/tablesdb/get-index.md new file mode 100644 index 0000000..d14579d --- /dev/null +++ b/docs/examples/java/tablesdb/get-index.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getIndex( + "", // databaseId + "", // tableId + "", // key + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/get-row.md b/docs/examples/java/tablesdb/get-row.md new file mode 100644 index 0000000..03cf3fb --- /dev/null +++ b/docs/examples/java/tablesdb/get-row.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getRow( + "", // databaseId + "", // tableId + "", // rowId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/get-table.md b/docs/examples/java/tablesdb/get-table.md new file mode 100644 index 0000000..4486249 --- /dev/null +++ b/docs/examples/java/tablesdb/get-table.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.getTable( + "", // databaseId + "", // tableId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/get.md b/docs/examples/java/tablesdb/get.md new file mode 100644 index 0000000..6480d62 --- /dev/null +++ b/docs/examples/java/tablesdb/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.get( + "", // databaseId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/increment-row-column.md b/docs/examples/java/tablesdb/increment-row-column.md new file mode 100644 index 0000000..db48d05 --- /dev/null +++ b/docs/examples/java/tablesdb/increment-row-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.incrementRowColumn( + "", // databaseId + "", // tableId + "", // rowId + "", // column + 0, // value (optional) + 0, // max (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/list-columns.md b/docs/examples/java/tablesdb/list-columns.md new file mode 100644 index 0000000..f0e70d3 --- /dev/null +++ b/docs/examples/java/tablesdb/list-columns.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listColumns( + "", // databaseId + "", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/list-indexes.md b/docs/examples/java/tablesdb/list-indexes.md new file mode 100644 index 0000000..1e5d1f9 --- /dev/null +++ b/docs/examples/java/tablesdb/list-indexes.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listIndexes( + "", // databaseId + "", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/list-rows.md b/docs/examples/java/tablesdb/list-rows.md new file mode 100644 index 0000000..52cf2a1 --- /dev/null +++ b/docs/examples/java/tablesdb/list-rows.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listRows( + "", // databaseId + "", // tableId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/list-tables.md b/docs/examples/java/tablesdb/list-tables.md new file mode 100644 index 0000000..5e98cb6 --- /dev/null +++ b/docs/examples/java/tablesdb/list-tables.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.listTables( + "", // databaseId + listOf(), // queries (optional) + "", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/list.md b/docs/examples/java/tablesdb/list.md new file mode 100644 index 0000000..34dc9da --- /dev/null +++ b/docs/examples/java/tablesdb/list.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.list( + listOf(), // queries (optional) + "", // search (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-boolean-column.md b/docs/examples/java/tablesdb/update-boolean-column.md new file mode 100644 index 0000000..d31932f --- /dev/null +++ b/docs/examples/java/tablesdb/update-boolean-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateBooleanColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + false, // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-datetime-column.md b/docs/examples/java/tablesdb/update-datetime-column.md new file mode 100644 index 0000000..b9fb3b2 --- /dev/null +++ b/docs/examples/java/tablesdb/update-datetime-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateDatetimeColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-email-column.md b/docs/examples/java/tablesdb/update-email-column.md new file mode 100644 index 0000000..ed6b93b --- /dev/null +++ b/docs/examples/java/tablesdb/update-email-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateEmailColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "email@example.com", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-enum-column.md b/docs/examples/java/tablesdb/update-enum-column.md new file mode 100644 index 0000000..5a8036a --- /dev/null +++ b/docs/examples/java/tablesdb/update-enum-column.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateEnumColumn( + "", // databaseId + "", // tableId + "", // key + listOf(), // elements + false, // required + "", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-float-column.md b/docs/examples/java/tablesdb/update-float-column.md new file mode 100644 index 0000000..0487c06 --- /dev/null +++ b/docs/examples/java/tablesdb/update-float-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateFloatColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + 0, // default + 0, // min (optional) + 0, // max (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-integer-column.md b/docs/examples/java/tablesdb/update-integer-column.md new file mode 100644 index 0000000..a9ed33a --- /dev/null +++ b/docs/examples/java/tablesdb/update-integer-column.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateIntegerColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + 0, // default + 0, // min (optional) + 0, // max (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-ip-column.md b/docs/examples/java/tablesdb/update-ip-column.md new file mode 100644 index 0000000..3250954 --- /dev/null +++ b/docs/examples/java/tablesdb/update-ip-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateIpColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-relationship-column.md b/docs/examples/java/tablesdb/update-relationship-column.md new file mode 100644 index 0000000..45aea8a --- /dev/null +++ b/docs/examples/java/tablesdb/update-relationship-column.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRelationshipColumn( + "", // databaseId + "", // tableId + "", // key + RelationMutate.CASCADE, // onDelete (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-row.md b/docs/examples/java/tablesdb/update-row.md new file mode 100644 index 0000000..bedc816 --- /dev/null +++ b/docs/examples/java/tablesdb/update-row.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRow( + "", // databaseId + "", // tableId + "", // rowId + mapOf( "a" to "b" ), // data (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-rows.md b/docs/examples/java/tablesdb/update-rows.md new file mode 100644 index 0000000..169b57c --- /dev/null +++ b/docs/examples/java/tablesdb/update-rows.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateRows( + "", // databaseId + "", // tableId + mapOf( "a" to "b" ), // data (optional) + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-string-column.md b/docs/examples/java/tablesdb/update-string-column.md new file mode 100644 index 0000000..36a2ed5 --- /dev/null +++ b/docs/examples/java/tablesdb/update-string-column.md @@ -0,0 +1,29 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateStringColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "", // default + 1, // size (optional) + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-table.md b/docs/examples/java/tablesdb/update-table.md new file mode 100644 index 0000000..e593a04 --- /dev/null +++ b/docs/examples/java/tablesdb/update-table.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateTable( + "", // databaseId + "", // tableId + "", // name + listOf("read("any")"), // permissions (optional) + false, // rowSecurity (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update-url-column.md b/docs/examples/java/tablesdb/update-url-column.md new file mode 100644 index 0000000..d2273b9 --- /dev/null +++ b/docs/examples/java/tablesdb/update-url-column.md @@ -0,0 +1,28 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.updateUrlColumn( + "", // databaseId + "", // tableId + "", // key + false, // required + "https://example.com", // default + "", // newKey (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/update.md b/docs/examples/java/tablesdb/update.md new file mode 100644 index 0000000..3b1da0c --- /dev/null +++ b/docs/examples/java/tablesdb/update.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.update( + "", // databaseId + "", // name + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/upsert-row.md b/docs/examples/java/tablesdb/upsert-row.md new file mode 100644 index 0000000..d6155fc --- /dev/null +++ b/docs/examples/java/tablesdb/upsert-row.md @@ -0,0 +1,27 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.upsertRow( + "", // databaseId + "", // tableId + "", // rowId + mapOf( "a" to "b" ), // data (optional) + listOf("read("any")"), // permissions (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tablesdb/upsert-rows.md b/docs/examples/java/tablesdb/upsert-rows.md new file mode 100644 index 0000000..da15f6a --- /dev/null +++ b/docs/examples/java/tablesdb/upsert-rows.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.TablesDB; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +TablesDB tablesDB = new TablesDB(client); + +tablesDB.upsertRows( + "", // databaseId + "", // tableId + listOf(), // rows + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/teams/create-membership.md b/docs/examples/java/teams/create-membership.md index f7a4ecb..89e9d96 100644 --- a/docs/examples/java/teams/create-membership.md +++ b/docs/examples/java/teams/create-membership.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/create.md b/docs/examples/java/teams/create.md index e8fb127..28cc3da 100644 --- a/docs/examples/java/teams/create.md +++ b/docs/examples/java/teams/create.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/delete-membership.md b/docs/examples/java/teams/delete-membership.md index 0fe1e17..3b414be 100644 --- a/docs/examples/java/teams/delete-membership.md +++ b/docs/examples/java/teams/delete-membership.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/delete.md b/docs/examples/java/teams/delete.md index 74f5a7c..07f5c12 100644 --- a/docs/examples/java/teams/delete.md +++ b/docs/examples/java/teams/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/get-membership.md b/docs/examples/java/teams/get-membership.md index d013d91..e7c1571 100644 --- a/docs/examples/java/teams/get-membership.md +++ b/docs/examples/java/teams/get-membership.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/get-prefs.md b/docs/examples/java/teams/get-prefs.md index 27cd6f9..6d30814 100644 --- a/docs/examples/java/teams/get-prefs.md +++ b/docs/examples/java/teams/get-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/get.md b/docs/examples/java/teams/get.md index 0416602..a479e9a 100644 --- a/docs/examples/java/teams/get.md +++ b/docs/examples/java/teams/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/list-memberships.md b/docs/examples/java/teams/list-memberships.md index 0260673..9694482 100644 --- a/docs/examples/java/teams/list-memberships.md +++ b/docs/examples/java/teams/list-memberships.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/list.md b/docs/examples/java/teams/list.md index a4e85ac..d0855ba 100644 --- a/docs/examples/java/teams/list.md +++ b/docs/examples/java/teams/list.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/update-membership-status.md b/docs/examples/java/teams/update-membership-status.md index 8ca3398..461cf4c 100644 --- a/docs/examples/java/teams/update-membership-status.md +++ b/docs/examples/java/teams/update-membership-status.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/update-membership.md b/docs/examples/java/teams/update-membership.md index 60be82c..d4816c5 100644 --- a/docs/examples/java/teams/update-membership.md +++ b/docs/examples/java/teams/update-membership.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/update-name.md b/docs/examples/java/teams/update-name.md index 8db6f04..f2f1b02 100644 --- a/docs/examples/java/teams/update-name.md +++ b/docs/examples/java/teams/update-name.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/teams/update-prefs.md b/docs/examples/java/teams/update-prefs.md index 91f1492..2ef0522 100644 --- a/docs/examples/java/teams/update-prefs.md +++ b/docs/examples/java/teams/update-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Teams; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession(""); // The user session to authenticate with diff --git a/docs/examples/java/tokens/create-file-token.md b/docs/examples/java/tokens/create-file-token.md new file mode 100644 index 0000000..6996641 --- /dev/null +++ b/docs/examples/java/tokens/create-file-token.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.createFileToken( + "", // bucketId + "", // fileId + "", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tokens/delete.md b/docs/examples/java/tokens/delete.md new file mode 100644 index 0000000..bf1874d --- /dev/null +++ b/docs/examples/java/tokens/delete.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.delete( + "", // tokenId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tokens/get.md b/docs/examples/java/tokens/get.md new file mode 100644 index 0000000..c55563c --- /dev/null +++ b/docs/examples/java/tokens/get.md @@ -0,0 +1,23 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.get( + "", // tokenId + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tokens/list.md b/docs/examples/java/tokens/list.md new file mode 100644 index 0000000..a59e9f5 --- /dev/null +++ b/docs/examples/java/tokens/list.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.list( + "", // bucketId + "", // fileId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/tokens/update.md b/docs/examples/java/tokens/update.md new file mode 100644 index 0000000..2a44f2d --- /dev/null +++ b/docs/examples/java/tokens/update.md @@ -0,0 +1,24 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Tokens; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Tokens tokens = new Tokens(client); + +tokens.update( + "", // tokenId + "", // expire (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/users/create-argon2user.md b/docs/examples/java/users/create-argon-2-user.md similarity index 88% rename from docs/examples/java/users/create-argon2user.md rename to docs/examples/java/users/create-argon-2-user.md index 0127526..c78f236 100644 --- a/docs/examples/java/users/create-argon2user.md +++ b/docs/examples/java/users/create-argon-2-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-bcrypt-user.md b/docs/examples/java/users/create-bcrypt-user.md index c98939b..7b85f96 100644 --- a/docs/examples/java/users/create-bcrypt-user.md +++ b/docs/examples/java/users/create-bcrypt-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-j-w-t.md b/docs/examples/java/users/create-jwt.md similarity index 88% rename from docs/examples/java/users/create-j-w-t.md rename to docs/examples/java/users/create-jwt.md index c4538b7..2b4d7e9 100644 --- a/docs/examples/java/users/create-j-w-t.md +++ b/docs/examples/java/users/create-jwt.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-m-d5user.md b/docs/examples/java/users/create-md-5-user.md similarity index 88% rename from docs/examples/java/users/create-m-d5user.md rename to docs/examples/java/users/create-md-5-user.md index 0456a77..666e107 100644 --- a/docs/examples/java/users/create-m-d5user.md +++ b/docs/examples/java/users/create-md-5-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-mfa-recovery-codes.md b/docs/examples/java/users/create-mfa-recovery-codes.md index f9dfbe8..167c92c 100644 --- a/docs/examples/java/users/create-mfa-recovery-codes.md +++ b/docs/examples/java/users/create-mfa-recovery-codes.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Users users = new Users(client); -users.createMfaRecoveryCodes( +users.createMFARecoveryCodes( "", // userId new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/users/create-p-h-pass-user.md b/docs/examples/java/users/create-ph-pass-user.md similarity index 88% rename from docs/examples/java/users/create-p-h-pass-user.md rename to docs/examples/java/users/create-ph-pass-user.md index e977678..048ba39 100644 --- a/docs/examples/java/users/create-p-h-pass-user.md +++ b/docs/examples/java/users/create-ph-pass-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-scrypt-modified-user.md b/docs/examples/java/users/create-scrypt-modified-user.md index 28d5881..77a7d5f 100644 --- a/docs/examples/java/users/create-scrypt-modified-user.md +++ b/docs/examples/java/users/create-scrypt-modified-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-scrypt-user.md b/docs/examples/java/users/create-scrypt-user.md index 43e1ad8..0e81237 100644 --- a/docs/examples/java/users/create-scrypt-user.md +++ b/docs/examples/java/users/create-scrypt-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-session.md b/docs/examples/java/users/create-session.md index bc7dfb0..8d9ce03 100644 --- a/docs/examples/java/users/create-session.md +++ b/docs/examples/java/users/create-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-s-h-a-user.md b/docs/examples/java/users/create-sha-user.md similarity index 89% rename from docs/examples/java/users/create-s-h-a-user.md rename to docs/examples/java/users/create-sha-user.md index 6a3869c..ad72907 100644 --- a/docs/examples/java/users/create-s-h-a-user.md +++ b/docs/examples/java/users/create-sha-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-target.md b/docs/examples/java/users/create-target.md index 6bad1ce..6681b17 100644 --- a/docs/examples/java/users/create-target.md +++ b/docs/examples/java/users/create-target.md @@ -4,7 +4,7 @@ import io.appwrite.services.Users; import io.appwrite.enums.MessagingProviderType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create-token.md b/docs/examples/java/users/create-token.md index 9389e0e..330b344 100644 --- a/docs/examples/java/users/create-token.md +++ b/docs/examples/java/users/create-token.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/create.md b/docs/examples/java/users/create.md index 9889129..95a72bf 100644 --- a/docs/examples/java/users/create.md +++ b/docs/examples/java/users/create.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/delete-identity.md b/docs/examples/java/users/delete-identity.md index 063a91d..40c410d 100644 --- a/docs/examples/java/users/delete-identity.md +++ b/docs/examples/java/users/delete-identity.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/delete-mfa-authenticator.md b/docs/examples/java/users/delete-mfa-authenticator.md index cd5d9ab..c27b39e 100644 --- a/docs/examples/java/users/delete-mfa-authenticator.md +++ b/docs/examples/java/users/delete-mfa-authenticator.md @@ -4,13 +4,13 @@ import io.appwrite.services.Users; import io.appwrite.enums.AuthenticatorType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Users users = new Users(client); -users.deleteMfaAuthenticator( +users.deleteMFAAuthenticator( "", // userId AuthenticatorType.TOTP, // type new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/users/delete-session.md b/docs/examples/java/users/delete-session.md index 4ed2713..0e0a52b 100644 --- a/docs/examples/java/users/delete-session.md +++ b/docs/examples/java/users/delete-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/delete-sessions.md b/docs/examples/java/users/delete-sessions.md index f0da6e0..6a3bbbf 100644 --- a/docs/examples/java/users/delete-sessions.md +++ b/docs/examples/java/users/delete-sessions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/delete-target.md b/docs/examples/java/users/delete-target.md index ddd0460..e38ee1d 100644 --- a/docs/examples/java/users/delete-target.md +++ b/docs/examples/java/users/delete-target.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/delete.md b/docs/examples/java/users/delete.md index 6a256f8..d207f9a 100644 --- a/docs/examples/java/users/delete.md +++ b/docs/examples/java/users/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/get-mfa-recovery-codes.md b/docs/examples/java/users/get-mfa-recovery-codes.md index be33d20..e617355 100644 --- a/docs/examples/java/users/get-mfa-recovery-codes.md +++ b/docs/examples/java/users/get-mfa-recovery-codes.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Users users = new Users(client); -users.getMfaRecoveryCodes( +users.getMFARecoveryCodes( "", // userId new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/users/get-prefs.md b/docs/examples/java/users/get-prefs.md index 3e36f16..9ff3e4b 100644 --- a/docs/examples/java/users/get-prefs.md +++ b/docs/examples/java/users/get-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/get-target.md b/docs/examples/java/users/get-target.md index 2ee5b4a..05c8028 100644 --- a/docs/examples/java/users/get-target.md +++ b/docs/examples/java/users/get-target.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/get.md b/docs/examples/java/users/get.md index 8c34eba..d8cd707 100644 --- a/docs/examples/java/users/get.md +++ b/docs/examples/java/users/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/list-identities.md b/docs/examples/java/users/list-identities.md index 169b414..e0fc9d1 100644 --- a/docs/examples/java/users/list-identities.md +++ b/docs/examples/java/users/list-identities.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/list-logs.md b/docs/examples/java/users/list-logs.md index f3d2701..86c94ee 100644 --- a/docs/examples/java/users/list-logs.md +++ b/docs/examples/java/users/list-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/list-memberships.md b/docs/examples/java/users/list-memberships.md index 4f3cfd8..d0cee13 100644 --- a/docs/examples/java/users/list-memberships.md +++ b/docs/examples/java/users/list-memberships.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key @@ -11,6 +11,8 @@ Users users = new Users(client); users.listMemberships( "", // userId + listOf(), // queries (optional) + "", // search (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/users/list-mfa-factors.md b/docs/examples/java/users/list-mfa-factors.md index 4d51ece..c26f463 100644 --- a/docs/examples/java/users/list-mfa-factors.md +++ b/docs/examples/java/users/list-mfa-factors.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Users users = new Users(client); -users.listMfaFactors( +users.listMFAFactors( "", // userId new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/users/list-sessions.md b/docs/examples/java/users/list-sessions.md index a1d3a3a..7e13cb3 100644 --- a/docs/examples/java/users/list-sessions.md +++ b/docs/examples/java/users/list-sessions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/list-targets.md b/docs/examples/java/users/list-targets.md index ab04577..efa7542 100644 --- a/docs/examples/java/users/list-targets.md +++ b/docs/examples/java/users/list-targets.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/list.md b/docs/examples/java/users/list.md index a854ba0..d587eaf 100644 --- a/docs/examples/java/users/list.md +++ b/docs/examples/java/users/list.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-email-verification.md b/docs/examples/java/users/update-email-verification.md index 7423f77..a79c87b 100644 --- a/docs/examples/java/users/update-email-verification.md +++ b/docs/examples/java/users/update-email-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-email.md b/docs/examples/java/users/update-email.md index 23e3977..24cdb00 100644 --- a/docs/examples/java/users/update-email.md +++ b/docs/examples/java/users/update-email.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-labels.md b/docs/examples/java/users/update-labels.md index acc3d1b..379200a 100644 --- a/docs/examples/java/users/update-labels.md +++ b/docs/examples/java/users/update-labels.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-mfa-recovery-codes.md b/docs/examples/java/users/update-mfa-recovery-codes.md index eb560e7..98522b6 100644 --- a/docs/examples/java/users/update-mfa-recovery-codes.md +++ b/docs/examples/java/users/update-mfa-recovery-codes.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Users users = new Users(client); -users.updateMfaRecoveryCodes( +users.updateMFARecoveryCodes( "", // userId new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/users/update-mfa.md b/docs/examples/java/users/update-mfa.md index e1fc96f..dbcded6 100644 --- a/docs/examples/java/users/update-mfa.md +++ b/docs/examples/java/users/update-mfa.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key Users users = new Users(client); -users.updateMfa( +users.updateMFA( "", // userId false, // mfa new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/users/update-name.md b/docs/examples/java/users/update-name.md index e8bfe56..b4f889c 100644 --- a/docs/examples/java/users/update-name.md +++ b/docs/examples/java/users/update-name.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-password.md b/docs/examples/java/users/update-password.md index bdf31a7..94e24da 100644 --- a/docs/examples/java/users/update-password.md +++ b/docs/examples/java/users/update-password.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-phone-verification.md b/docs/examples/java/users/update-phone-verification.md index ce2377b..4a1d5a2 100644 --- a/docs/examples/java/users/update-phone-verification.md +++ b/docs/examples/java/users/update-phone-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-phone.md b/docs/examples/java/users/update-phone.md index e0a0a49..49477fa 100644 --- a/docs/examples/java/users/update-phone.md +++ b/docs/examples/java/users/update-phone.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-prefs.md b/docs/examples/java/users/update-prefs.md index 1d1cc7c..c5a9677 100644 --- a/docs/examples/java/users/update-prefs.md +++ b/docs/examples/java/users/update-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-status.md b/docs/examples/java/users/update-status.md index e757ece..6e875b9 100644 --- a/docs/examples/java/users/update-status.md +++ b/docs/examples/java/users/update-status.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/java/users/update-target.md b/docs/examples/java/users/update-target.md index 23ca8d0..67b90bf 100644 --- a/docs/examples/java/users/update-target.md +++ b/docs/examples/java/users/update-target.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Users; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey(""); // Your secret API key diff --git a/docs/examples/kotlin/account/create-anonymous-session.md b/docs/examples/kotlin/account/create-anonymous-session.md index 932b8a7..0ddc383 100644 --- a/docs/examples/kotlin/account/create-anonymous-session.md +++ b/docs/examples/kotlin/account/create-anonymous-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/create-email-password-session.md b/docs/examples/kotlin/account/create-email-password-session.md index cc3b8cb..9c7af95 100644 --- a/docs/examples/kotlin/account/create-email-password-session.md +++ b/docs/examples/kotlin/account/create-email-password-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/create-email-token.md b/docs/examples/kotlin/account/create-email-token.md index b56e489..84acd78 100644 --- a/docs/examples/kotlin/account/create-email-token.md +++ b/docs/examples/kotlin/account/create-email-token.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/create-j-w-t.md b/docs/examples/kotlin/account/create-jwt.md similarity index 76% rename from docs/examples/kotlin/account/create-j-w-t.md rename to docs/examples/kotlin/account/create-jwt.md index a0208cb..4c04aa1 100644 --- a/docs/examples/kotlin/account/create-j-w-t.md +++ b/docs/examples/kotlin/account/create-jwt.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/create-magic-u-r-l-token.md b/docs/examples/kotlin/account/create-magic-url-token.md similarity index 83% rename from docs/examples/kotlin/account/create-magic-u-r-l-token.md rename to docs/examples/kotlin/account/create-magic-url-token.md index ba66695..c1d8cba 100644 --- a/docs/examples/kotlin/account/create-magic-u-r-l-token.md +++ b/docs/examples/kotlin/account/create-magic-url-token.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/create-mfa-authenticator.md b/docs/examples/kotlin/account/create-mfa-authenticator.md index 0afd790..fed90b4 100644 --- a/docs/examples/kotlin/account/create-mfa-authenticator.md +++ b/docs/examples/kotlin/account/create-mfa-authenticator.md @@ -4,12 +4,12 @@ import io.appwrite.services.Account import io.appwrite.enums.AuthenticatorType val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with val account = Account(client) -val response = account.createMfaAuthenticator( +val response = account.createMFAAuthenticator( type = AuthenticatorType.TOTP ) diff --git a/docs/examples/kotlin/account/create-mfa-challenge.md b/docs/examples/kotlin/account/create-mfa-challenge.md index 921e791..7213142 100644 --- a/docs/examples/kotlin/account/create-mfa-challenge.md +++ b/docs/examples/kotlin/account/create-mfa-challenge.md @@ -4,11 +4,11 @@ import io.appwrite.services.Account import io.appwrite.enums.AuthenticationFactor val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) -val response = account.createMfaChallenge( +val response = account.createMFAChallenge( factor = AuthenticationFactor.EMAIL ) diff --git a/docs/examples/kotlin/account/create-mfa-recovery-codes.md b/docs/examples/kotlin/account/create-mfa-recovery-codes.md index 270feda..c01499b 100644 --- a/docs/examples/kotlin/account/create-mfa-recovery-codes.md +++ b/docs/examples/kotlin/account/create-mfa-recovery-codes.md @@ -3,10 +3,10 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with val account = Account(client) -val response = account.createMfaRecoveryCodes() +val response = account.createMFARecoveryCodes() diff --git a/docs/examples/kotlin/account/create-o-auth2token.md b/docs/examples/kotlin/account/create-o-auth-2-token.md similarity index 85% rename from docs/examples/kotlin/account/create-o-auth2token.md rename to docs/examples/kotlin/account/create-o-auth-2-token.md index 62d176d..1a8c118 100644 --- a/docs/examples/kotlin/account/create-o-auth2token.md +++ b/docs/examples/kotlin/account/create-o-auth-2-token.md @@ -4,7 +4,7 @@ import io.appwrite.services.Account import io.appwrite.enums.OAuthProvider val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/create-phone-token.md b/docs/examples/kotlin/account/create-phone-token.md index b9633e7..be03e06 100644 --- a/docs/examples/kotlin/account/create-phone-token.md +++ b/docs/examples/kotlin/account/create-phone-token.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/create-phone-verification.md b/docs/examples/kotlin/account/create-phone-verification.md index 038d72e..3ae45b3 100644 --- a/docs/examples/kotlin/account/create-phone-verification.md +++ b/docs/examples/kotlin/account/create-phone-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/create-recovery.md b/docs/examples/kotlin/account/create-recovery.md index 27c6af5..949219c 100644 --- a/docs/examples/kotlin/account/create-recovery.md +++ b/docs/examples/kotlin/account/create-recovery.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/create-session.md b/docs/examples/kotlin/account/create-session.md index 5e6c47c..5afb219 100644 --- a/docs/examples/kotlin/account/create-session.md +++ b/docs/examples/kotlin/account/create-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/create-verification.md b/docs/examples/kotlin/account/create-verification.md index 0d42f8a..f3441c9 100644 --- a/docs/examples/kotlin/account/create-verification.md +++ b/docs/examples/kotlin/account/create-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/create.md b/docs/examples/kotlin/account/create.md index 19d7c12..80640ba 100644 --- a/docs/examples/kotlin/account/create.md +++ b/docs/examples/kotlin/account/create.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/delete-identity.md b/docs/examples/kotlin/account/delete-identity.md index f6ede24..f9a5ce0 100644 --- a/docs/examples/kotlin/account/delete-identity.md +++ b/docs/examples/kotlin/account/delete-identity.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/delete-mfa-authenticator.md b/docs/examples/kotlin/account/delete-mfa-authenticator.md index ffa853f..9b06f8c 100644 --- a/docs/examples/kotlin/account/delete-mfa-authenticator.md +++ b/docs/examples/kotlin/account/delete-mfa-authenticator.md @@ -4,12 +4,12 @@ import io.appwrite.services.Account import io.appwrite.enums.AuthenticatorType val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with val account = Account(client) -val response = account.deleteMfaAuthenticator( +val response = account.deleteMFAAuthenticator( type = AuthenticatorType.TOTP ) diff --git a/docs/examples/kotlin/account/delete-session.md b/docs/examples/kotlin/account/delete-session.md index 47b80d7..31096cc 100644 --- a/docs/examples/kotlin/account/delete-session.md +++ b/docs/examples/kotlin/account/delete-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/delete-sessions.md b/docs/examples/kotlin/account/delete-sessions.md index b2571de..dc29fb8 100644 --- a/docs/examples/kotlin/account/delete-sessions.md +++ b/docs/examples/kotlin/account/delete-sessions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/get-mfa-recovery-codes.md b/docs/examples/kotlin/account/get-mfa-recovery-codes.md index 5335a0d..96567f4 100644 --- a/docs/examples/kotlin/account/get-mfa-recovery-codes.md +++ b/docs/examples/kotlin/account/get-mfa-recovery-codes.md @@ -3,10 +3,10 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with val account = Account(client) -val response = account.getMfaRecoveryCodes() +val response = account.getMFARecoveryCodes() diff --git a/docs/examples/kotlin/account/get-prefs.md b/docs/examples/kotlin/account/get-prefs.md index 3705645..299abbd 100644 --- a/docs/examples/kotlin/account/get-prefs.md +++ b/docs/examples/kotlin/account/get-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/get-session.md b/docs/examples/kotlin/account/get-session.md index 78478e1..e40297e 100644 --- a/docs/examples/kotlin/account/get-session.md +++ b/docs/examples/kotlin/account/get-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/get.md b/docs/examples/kotlin/account/get.md index 84f9bc3..f65f4fd 100644 --- a/docs/examples/kotlin/account/get.md +++ b/docs/examples/kotlin/account/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/list-identities.md b/docs/examples/kotlin/account/list-identities.md index f947de3..32eb86c 100644 --- a/docs/examples/kotlin/account/list-identities.md +++ b/docs/examples/kotlin/account/list-identities.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/list-logs.md b/docs/examples/kotlin/account/list-logs.md index ba926ae..345b2f1 100644 --- a/docs/examples/kotlin/account/list-logs.md +++ b/docs/examples/kotlin/account/list-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/list-mfa-factors.md b/docs/examples/kotlin/account/list-mfa-factors.md index ee07a48..0f073df 100644 --- a/docs/examples/kotlin/account/list-mfa-factors.md +++ b/docs/examples/kotlin/account/list-mfa-factors.md @@ -3,10 +3,10 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with val account = Account(client) -val response = account.listMfaFactors() +val response = account.listMFAFactors() diff --git a/docs/examples/kotlin/account/list-sessions.md b/docs/examples/kotlin/account/list-sessions.md index 7f23ad3..899260c 100644 --- a/docs/examples/kotlin/account/list-sessions.md +++ b/docs/examples/kotlin/account/list-sessions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-email.md b/docs/examples/kotlin/account/update-email.md index c10c25e..6ebe5e7 100644 --- a/docs/examples/kotlin/account/update-email.md +++ b/docs/examples/kotlin/account/update-email.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-magic-u-r-l-session.md b/docs/examples/kotlin/account/update-magic-url-session.md similarity index 80% rename from docs/examples/kotlin/account/update-magic-u-r-l-session.md rename to docs/examples/kotlin/account/update-magic-url-session.md index 99b65eb..d4fe7f4 100644 --- a/docs/examples/kotlin/account/update-magic-u-r-l-session.md +++ b/docs/examples/kotlin/account/update-magic-url-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/update-mfa-authenticator.md b/docs/examples/kotlin/account/update-mfa-authenticator.md index 482dfb3..99764f2 100644 --- a/docs/examples/kotlin/account/update-mfa-authenticator.md +++ b/docs/examples/kotlin/account/update-mfa-authenticator.md @@ -4,13 +4,13 @@ import io.appwrite.services.Account import io.appwrite.enums.AuthenticatorType val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with val account = Account(client) -val response = account.updateMfaAuthenticator( +val response = account.updateMFAAuthenticator( type = AuthenticatorType.TOTP, otp = "" ) diff --git a/docs/examples/kotlin/account/update-mfa-challenge.md b/docs/examples/kotlin/account/update-mfa-challenge.md index 2a9a1a4..de90873 100644 --- a/docs/examples/kotlin/account/update-mfa-challenge.md +++ b/docs/examples/kotlin/account/update-mfa-challenge.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with val account = Account(client) -val response = account.updateMfaChallenge( +val response = account.updateMFAChallenge( challengeId = "", otp = "" ) diff --git a/docs/examples/kotlin/account/update-mfa-recovery-codes.md b/docs/examples/kotlin/account/update-mfa-recovery-codes.md index ebc6d71..05f6476 100644 --- a/docs/examples/kotlin/account/update-mfa-recovery-codes.md +++ b/docs/examples/kotlin/account/update-mfa-recovery-codes.md @@ -3,10 +3,10 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with val account = Account(client) -val response = account.updateMfaRecoveryCodes() +val response = account.updateMFARecoveryCodes() diff --git a/docs/examples/kotlin/account/update-m-f-a.md b/docs/examples/kotlin/account/update-mfa.md similarity index 80% rename from docs/examples/kotlin/account/update-m-f-a.md rename to docs/examples/kotlin/account/update-mfa.md index 516f14d..e12e8e0 100644 --- a/docs/examples/kotlin/account/update-m-f-a.md +++ b/docs/examples/kotlin/account/update-mfa.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-name.md b/docs/examples/kotlin/account/update-name.md index 13f9019..ecb7a2b 100644 --- a/docs/examples/kotlin/account/update-name.md +++ b/docs/examples/kotlin/account/update-name.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-password.md b/docs/examples/kotlin/account/update-password.md index fbb6796..159aa79 100644 --- a/docs/examples/kotlin/account/update-password.md +++ b/docs/examples/kotlin/account/update-password.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-phone-session.md b/docs/examples/kotlin/account/update-phone-session.md index 1f6aa40..1bcc4c0 100644 --- a/docs/examples/kotlin/account/update-phone-session.md +++ b/docs/examples/kotlin/account/update-phone-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID val account = Account(client) diff --git a/docs/examples/kotlin/account/update-phone-verification.md b/docs/examples/kotlin/account/update-phone-verification.md index 87cd3ff..36a2d9c 100644 --- a/docs/examples/kotlin/account/update-phone-verification.md +++ b/docs/examples/kotlin/account/update-phone-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-phone.md b/docs/examples/kotlin/account/update-phone.md index 1a2600c..1ee4cbd 100644 --- a/docs/examples/kotlin/account/update-phone.md +++ b/docs/examples/kotlin/account/update-phone.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-prefs.md b/docs/examples/kotlin/account/update-prefs.md index 32d083b..dafee7c 100644 --- a/docs/examples/kotlin/account/update-prefs.md +++ b/docs/examples/kotlin/account/update-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-recovery.md b/docs/examples/kotlin/account/update-recovery.md index 8626e97..e563813 100644 --- a/docs/examples/kotlin/account/update-recovery.md +++ b/docs/examples/kotlin/account/update-recovery.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-session.md b/docs/examples/kotlin/account/update-session.md index 5f83a2b..ab3730a 100644 --- a/docs/examples/kotlin/account/update-session.md +++ b/docs/examples/kotlin/account/update-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-status.md b/docs/examples/kotlin/account/update-status.md index aa94ade..021f614 100644 --- a/docs/examples/kotlin/account/update-status.md +++ b/docs/examples/kotlin/account/update-status.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/account/update-verification.md b/docs/examples/kotlin/account/update-verification.md index 2f8cc25..6402093 100644 --- a/docs/examples/kotlin/account/update-verification.md +++ b/docs/examples/kotlin/account/update-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Account val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/avatars/get-browser.md b/docs/examples/kotlin/avatars/get-browser.md index 0e29e11..f289205 100644 --- a/docs/examples/kotlin/avatars/get-browser.md +++ b/docs/examples/kotlin/avatars/get-browser.md @@ -4,7 +4,7 @@ import io.appwrite.services.Avatars import io.appwrite.enums.Browser val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with @@ -14,5 +14,5 @@ val result = avatars.getBrowser( code = Browser.AVANT_BROWSER, width = 0, // optional height = 0, // optional - quality = 0 // optional + quality = -1 // optional ) diff --git a/docs/examples/kotlin/avatars/get-credit-card.md b/docs/examples/kotlin/avatars/get-credit-card.md index 9929e76..1fd00a2 100644 --- a/docs/examples/kotlin/avatars/get-credit-card.md +++ b/docs/examples/kotlin/avatars/get-credit-card.md @@ -4,7 +4,7 @@ import io.appwrite.services.Avatars import io.appwrite.enums.CreditCard val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with @@ -14,5 +14,5 @@ val result = avatars.getCreditCard( code = CreditCard.AMERICAN_EXPRESS, width = 0, // optional height = 0, // optional - quality = 0 // optional + quality = -1 // optional ) diff --git a/docs/examples/kotlin/avatars/get-favicon.md b/docs/examples/kotlin/avatars/get-favicon.md index 8cf4af2..d1f5d9b 100644 --- a/docs/examples/kotlin/avatars/get-favicon.md +++ b/docs/examples/kotlin/avatars/get-favicon.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Avatars val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/avatars/get-flag.md b/docs/examples/kotlin/avatars/get-flag.md index 73f3fef..a16aefc 100644 --- a/docs/examples/kotlin/avatars/get-flag.md +++ b/docs/examples/kotlin/avatars/get-flag.md @@ -4,7 +4,7 @@ import io.appwrite.services.Avatars import io.appwrite.enums.Flag val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with @@ -14,5 +14,5 @@ val result = avatars.getFlag( code = Flag.AFGHANISTAN, width = 0, // optional height = 0, // optional - quality = 0 // optional + quality = -1 // optional ) diff --git a/docs/examples/kotlin/avatars/get-image.md b/docs/examples/kotlin/avatars/get-image.md index 1369000..98b9c07 100644 --- a/docs/examples/kotlin/avatars/get-image.md +++ b/docs/examples/kotlin/avatars/get-image.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Avatars val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/avatars/get-initials.md b/docs/examples/kotlin/avatars/get-initials.md index 9549924..2aa165c 100644 --- a/docs/examples/kotlin/avatars/get-initials.md +++ b/docs/examples/kotlin/avatars/get-initials.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Avatars val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/avatars/get-q-r.md b/docs/examples/kotlin/avatars/get-qr.md similarity index 84% rename from docs/examples/kotlin/avatars/get-q-r.md rename to docs/examples/kotlin/avatars/get-qr.md index cea667b..abcf488 100644 --- a/docs/examples/kotlin/avatars/get-q-r.md +++ b/docs/examples/kotlin/avatars/get-qr.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Avatars val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/databases/create-boolean-attribute.md b/docs/examples/kotlin/databases/create-boolean-attribute.md index 64ac210..b80bd94 100644 --- a/docs/examples/kotlin/databases/create-boolean-attribute.md +++ b/docs/examples/kotlin/databases/create-boolean-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-collection.md b/docs/examples/kotlin/databases/create-collection.md index 03ca6a4..de9679f 100644 --- a/docs/examples/kotlin/databases/create-collection.md +++ b/docs/examples/kotlin/databases/create-collection.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-datetime-attribute.md b/docs/examples/kotlin/databases/create-datetime-attribute.md index d9e0771..2d73056 100644 --- a/docs/examples/kotlin/databases/create-datetime-attribute.md +++ b/docs/examples/kotlin/databases/create-datetime-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-document.md b/docs/examples/kotlin/databases/create-document.md index 873e2ed..695fdbd 100644 --- a/docs/examples/kotlin/databases/create-document.md +++ b/docs/examples/kotlin/databases/create-document.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/databases/create-documents.md b/docs/examples/kotlin/databases/create-documents.md new file mode 100644 index 0000000..41a98dc --- /dev/null +++ b/docs/examples/kotlin/databases/create-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val databases = Databases(client) + +val response = databases.createDocuments( + databaseId = "", + collectionId = "", + documents = listOf() +) diff --git a/docs/examples/kotlin/databases/create-email-attribute.md b/docs/examples/kotlin/databases/create-email-attribute.md index 5e5091b..2a5a9c2 100644 --- a/docs/examples/kotlin/databases/create-email-attribute.md +++ b/docs/examples/kotlin/databases/create-email-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-enum-attribute.md b/docs/examples/kotlin/databases/create-enum-attribute.md index 733fbad..d9decde 100644 --- a/docs/examples/kotlin/databases/create-enum-attribute.md +++ b/docs/examples/kotlin/databases/create-enum-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-float-attribute.md b/docs/examples/kotlin/databases/create-float-attribute.md index 04e9bfa..5ca86a6 100644 --- a/docs/examples/kotlin/databases/create-float-attribute.md +++ b/docs/examples/kotlin/databases/create-float-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-index.md b/docs/examples/kotlin/databases/create-index.md index 6dab46f..da777ac 100644 --- a/docs/examples/kotlin/databases/create-index.md +++ b/docs/examples/kotlin/databases/create-index.md @@ -4,7 +4,7 @@ import io.appwrite.services.Databases import io.appwrite.enums.IndexType val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key @@ -16,5 +16,6 @@ val response = databases.createIndex( key = "", type = IndexType.KEY, attributes = listOf(), - orders = listOf() // optional + orders = listOf(), // optional + lengths = listOf() // optional ) diff --git a/docs/examples/kotlin/databases/create-integer-attribute.md b/docs/examples/kotlin/databases/create-integer-attribute.md index 6c483bb..748d01a 100644 --- a/docs/examples/kotlin/databases/create-integer-attribute.md +++ b/docs/examples/kotlin/databases/create-integer-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-ip-attribute.md b/docs/examples/kotlin/databases/create-ip-attribute.md index 76dd82d..bfc6105 100644 --- a/docs/examples/kotlin/databases/create-ip-attribute.md +++ b/docs/examples/kotlin/databases/create-ip-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-relationship-attribute.md b/docs/examples/kotlin/databases/create-relationship-attribute.md index 4797b94..1bf6103 100644 --- a/docs/examples/kotlin/databases/create-relationship-attribute.md +++ b/docs/examples/kotlin/databases/create-relationship-attribute.md @@ -4,7 +4,7 @@ import io.appwrite.services.Databases import io.appwrite.enums.RelationshipType val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-string-attribute.md b/docs/examples/kotlin/databases/create-string-attribute.md index 06781f2..333cb76 100644 --- a/docs/examples/kotlin/databases/create-string-attribute.md +++ b/docs/examples/kotlin/databases/create-string-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create-url-attribute.md b/docs/examples/kotlin/databases/create-url-attribute.md index 33cadc7..06057d4 100644 --- a/docs/examples/kotlin/databases/create-url-attribute.md +++ b/docs/examples/kotlin/databases/create-url-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/create.md b/docs/examples/kotlin/databases/create.md index c17246f..04c6480 100644 --- a/docs/examples/kotlin/databases/create.md +++ b/docs/examples/kotlin/databases/create.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/decrement-document-attribute.md b/docs/examples/kotlin/databases/decrement-document-attribute.md new file mode 100644 index 0000000..d0226c0 --- /dev/null +++ b/docs/examples/kotlin/databases/decrement-document-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.decrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 0, // optional + min = 0 // optional +) diff --git a/docs/examples/kotlin/databases/delete-attribute.md b/docs/examples/kotlin/databases/delete-attribute.md index 8fed2d8..9a25155 100644 --- a/docs/examples/kotlin/databases/delete-attribute.md +++ b/docs/examples/kotlin/databases/delete-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/delete-collection.md b/docs/examples/kotlin/databases/delete-collection.md index 2c85947..c46ca08 100644 --- a/docs/examples/kotlin/databases/delete-collection.md +++ b/docs/examples/kotlin/databases/delete-collection.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/delete-document.md b/docs/examples/kotlin/databases/delete-document.md index e920841..a9eea6b 100644 --- a/docs/examples/kotlin/databases/delete-document.md +++ b/docs/examples/kotlin/databases/delete-document.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/databases/delete-documents.md b/docs/examples/kotlin/databases/delete-documents.md new file mode 100644 index 0000000..c4caa63 --- /dev/null +++ b/docs/examples/kotlin/databases/delete-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteDocuments( + databaseId = "", + collectionId = "", + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/databases/delete-index.md b/docs/examples/kotlin/databases/delete-index.md index 8655b6b..37c75dc 100644 --- a/docs/examples/kotlin/databases/delete-index.md +++ b/docs/examples/kotlin/databases/delete-index.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/delete.md b/docs/examples/kotlin/databases/delete.md index 13c5660..0722569 100644 --- a/docs/examples/kotlin/databases/delete.md +++ b/docs/examples/kotlin/databases/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/get-attribute.md b/docs/examples/kotlin/databases/get-attribute.md index 6a7ceb2..a59facd 100644 --- a/docs/examples/kotlin/databases/get-attribute.md +++ b/docs/examples/kotlin/databases/get-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/get-collection.md b/docs/examples/kotlin/databases/get-collection.md index 79980c5..7f6e578 100644 --- a/docs/examples/kotlin/databases/get-collection.md +++ b/docs/examples/kotlin/databases/get-collection.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/get-document.md b/docs/examples/kotlin/databases/get-document.md index 508e0da..d21a198 100644 --- a/docs/examples/kotlin/databases/get-document.md +++ b/docs/examples/kotlin/databases/get-document.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/databases/get-index.md b/docs/examples/kotlin/databases/get-index.md index 3935c38..39ac7af 100644 --- a/docs/examples/kotlin/databases/get-index.md +++ b/docs/examples/kotlin/databases/get-index.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/get.md b/docs/examples/kotlin/databases/get.md index bb6b17c..6ebb0c1 100644 --- a/docs/examples/kotlin/databases/get.md +++ b/docs/examples/kotlin/databases/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/increment-document-attribute.md b/docs/examples/kotlin/databases/increment-document-attribute.md new file mode 100644 index 0000000..b56ed91 --- /dev/null +++ b/docs/examples/kotlin/databases/increment-document-attribute.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.incrementDocumentAttribute( + databaseId = "", + collectionId = "", + documentId = "", + attribute = "", + value = 0, // optional + max = 0 // optional +) diff --git a/docs/examples/kotlin/databases/list-attributes.md b/docs/examples/kotlin/databases/list-attributes.md index b3f26a2..5ddb0a6 100644 --- a/docs/examples/kotlin/databases/list-attributes.md +++ b/docs/examples/kotlin/databases/list-attributes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/list-collections.md b/docs/examples/kotlin/databases/list-collections.md index 9bdfa6e..5340903 100644 --- a/docs/examples/kotlin/databases/list-collections.md +++ b/docs/examples/kotlin/databases/list-collections.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/list-documents.md b/docs/examples/kotlin/databases/list-documents.md index 90cef39..ed9cb31 100644 --- a/docs/examples/kotlin/databases/list-documents.md +++ b/docs/examples/kotlin/databases/list-documents.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/databases/list-indexes.md b/docs/examples/kotlin/databases/list-indexes.md index 6dd29ba..2ab2e6a 100644 --- a/docs/examples/kotlin/databases/list-indexes.md +++ b/docs/examples/kotlin/databases/list-indexes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/list.md b/docs/examples/kotlin/databases/list.md index f7f332b..cd61a0e 100644 --- a/docs/examples/kotlin/databases/list.md +++ b/docs/examples/kotlin/databases/list.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-boolean-attribute.md b/docs/examples/kotlin/databases/update-boolean-attribute.md index ebffab7..4c9fd91 100644 --- a/docs/examples/kotlin/databases/update-boolean-attribute.md +++ b/docs/examples/kotlin/databases/update-boolean-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-collection.md b/docs/examples/kotlin/databases/update-collection.md index 7ceef84..bd42ba0 100644 --- a/docs/examples/kotlin/databases/update-collection.md +++ b/docs/examples/kotlin/databases/update-collection.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-datetime-attribute.md b/docs/examples/kotlin/databases/update-datetime-attribute.md index 676c779..082ae1c 100644 --- a/docs/examples/kotlin/databases/update-datetime-attribute.md +++ b/docs/examples/kotlin/databases/update-datetime-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-document.md b/docs/examples/kotlin/databases/update-document.md index 1737be1..4dd0349 100644 --- a/docs/examples/kotlin/databases/update-document.md +++ b/docs/examples/kotlin/databases/update-document.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/databases/update-documents.md b/docs/examples/kotlin/databases/update-documents.md new file mode 100644 index 0000000..9d6c2b5 --- /dev/null +++ b/docs/examples/kotlin/databases/update-documents.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateDocuments( + databaseId = "", + collectionId = "", + data = mapOf( "a" to "b" ), // optional + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/databases/update-email-attribute.md b/docs/examples/kotlin/databases/update-email-attribute.md index 2f1cbd2..026bd64 100644 --- a/docs/examples/kotlin/databases/update-email-attribute.md +++ b/docs/examples/kotlin/databases/update-email-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-enum-attribute.md b/docs/examples/kotlin/databases/update-enum-attribute.md index 7c0c92f..e68a29c 100644 --- a/docs/examples/kotlin/databases/update-enum-attribute.md +++ b/docs/examples/kotlin/databases/update-enum-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-float-attribute.md b/docs/examples/kotlin/databases/update-float-attribute.md index 4701530..58b1107 100644 --- a/docs/examples/kotlin/databases/update-float-attribute.md +++ b/docs/examples/kotlin/databases/update-float-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key @@ -14,8 +14,8 @@ val response = databases.updateFloatAttribute( collectionId = "", key = "", required = false, - min = 0, - max = 0, default = 0, + min = 0, // optional + max = 0, // optional newKey = "" // optional ) diff --git a/docs/examples/kotlin/databases/update-integer-attribute.md b/docs/examples/kotlin/databases/update-integer-attribute.md index e5742a5..a00dcf9 100644 --- a/docs/examples/kotlin/databases/update-integer-attribute.md +++ b/docs/examples/kotlin/databases/update-integer-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key @@ -14,8 +14,8 @@ val response = databases.updateIntegerAttribute( collectionId = "", key = "", required = false, - min = 0, - max = 0, default = 0, + min = 0, // optional + max = 0, // optional newKey = "" // optional ) diff --git a/docs/examples/kotlin/databases/update-ip-attribute.md b/docs/examples/kotlin/databases/update-ip-attribute.md index bfc0cdd..505e5ea 100644 --- a/docs/examples/kotlin/databases/update-ip-attribute.md +++ b/docs/examples/kotlin/databases/update-ip-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-relationship-attribute.md b/docs/examples/kotlin/databases/update-relationship-attribute.md index ab12195..001dd1a 100644 --- a/docs/examples/kotlin/databases/update-relationship-attribute.md +++ b/docs/examples/kotlin/databases/update-relationship-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-string-attribute.md b/docs/examples/kotlin/databases/update-string-attribute.md index 32e17be..364a6b5 100644 --- a/docs/examples/kotlin/databases/update-string-attribute.md +++ b/docs/examples/kotlin/databases/update-string-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update-url-attribute.md b/docs/examples/kotlin/databases/update-url-attribute.md index 7835113..a628cc5 100644 --- a/docs/examples/kotlin/databases/update-url-attribute.md +++ b/docs/examples/kotlin/databases/update-url-attribute.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/update.md b/docs/examples/kotlin/databases/update.md index 7da795c..05f8327 100644 --- a/docs/examples/kotlin/databases/update.md +++ b/docs/examples/kotlin/databases/update.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/databases/upsert-document.md b/docs/examples/kotlin/databases/upsert-document.md new file mode 100644 index 0000000..d8be0e1 --- /dev/null +++ b/docs/examples/kotlin/databases/upsert-document.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.upsertDocument( + databaseId = "", + collectionId = "", + documentId = "", + data = mapOf( "a" to "b" ), + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/kotlin/databases/upsert-documents.md b/docs/examples/kotlin/databases/upsert-documents.md new file mode 100644 index 0000000..ca861c6 --- /dev/null +++ b/docs/examples/kotlin/databases/upsert-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val databases = Databases(client) + +val response = databases.upsertDocuments( + databaseId = "", + collectionId = "", + documents = listOf() +) diff --git a/docs/examples/kotlin/functions/create-deployment.md b/docs/examples/kotlin/functions/create-deployment.md index aba8f0c..ddc6e8b 100644 --- a/docs/examples/kotlin/functions/create-deployment.md +++ b/docs/examples/kotlin/functions/create-deployment.md @@ -4,7 +4,7 @@ import io.appwrite.models.InputFile import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/create-build.md b/docs/examples/kotlin/functions/create-duplicate-deployment.md similarity index 75% rename from docs/examples/kotlin/functions/create-build.md rename to docs/examples/kotlin/functions/create-duplicate-deployment.md index 6d20586..a3395f1 100644 --- a/docs/examples/kotlin/functions/create-build.md +++ b/docs/examples/kotlin/functions/create-duplicate-deployment.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val functions = Functions(client) -val response = functions.createBuild( +val response = functions.createDuplicateDeployment( functionId = "", deploymentId = "", buildId = "" // optional diff --git a/docs/examples/kotlin/functions/create-execution.md b/docs/examples/kotlin/functions/create-execution.md index 4226745..2734412 100644 --- a/docs/examples/kotlin/functions/create-execution.md +++ b/docs/examples/kotlin/functions/create-execution.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with @@ -16,5 +16,5 @@ val response = functions.createExecution( path = "", // optional method = "GET", // optional headers = mapOf( "a" to "b" ), // optional - scheduledAt = "" // optional + scheduledAt = "" // optional ) diff --git a/docs/examples/kotlin/functions/create-template-deployment.md b/docs/examples/kotlin/functions/create-template-deployment.md new file mode 100644 index 0000000..90c311e --- /dev/null +++ b/docs/examples/kotlin/functions/create-template-deployment.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val functions = Functions(client) + +val response = functions.createTemplateDeployment( + functionId = "", + repository = "", + owner = "", + rootDirectory = "", + version = "", + activate = false // optional +) diff --git a/docs/examples/kotlin/functions/create-variable.md b/docs/examples/kotlin/functions/create-variable.md index e5d33b4..061bc20 100644 --- a/docs/examples/kotlin/functions/create-variable.md +++ b/docs/examples/kotlin/functions/create-variable.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key @@ -12,5 +12,6 @@ val functions = Functions(client) val response = functions.createVariable( functionId = "", key = "", - value = "" + value = "", + secret = false // optional ) diff --git a/docs/examples/kotlin/functions/create-vcs-deployment.md b/docs/examples/kotlin/functions/create-vcs-deployment.md new file mode 100644 index 0000000..08bb5a3 --- /dev/null +++ b/docs/examples/kotlin/functions/create-vcs-deployment.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Functions +import io.appwrite.enums.VCSDeploymentType + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val functions = Functions(client) + +val response = functions.createVcsDeployment( + functionId = "", + type = VCSDeploymentType.BRANCH, + reference = "", + activate = false // optional +) diff --git a/docs/examples/kotlin/functions/create.md b/docs/examples/kotlin/functions/create.md index d94bdf6..c0ea4de 100644 --- a/docs/examples/kotlin/functions/create.md +++ b/docs/examples/kotlin/functions/create.md @@ -4,7 +4,7 @@ import io.appwrite.services.Functions import io.appwrite.enums.Runtime val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key @@ -28,9 +28,5 @@ val response = functions.create( providerBranch = "", // optional providerSilentMode = false, // optional providerRootDirectory = "", // optional - templateRepository = "", // optional - templateOwner = "", // optional - templateRootDirectory = "", // optional - templateVersion = "", // optional specification = "" // optional ) diff --git a/docs/examples/kotlin/functions/delete-deployment.md b/docs/examples/kotlin/functions/delete-deployment.md index 9e4e476..937fc96 100644 --- a/docs/examples/kotlin/functions/delete-deployment.md +++ b/docs/examples/kotlin/functions/delete-deployment.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/delete-execution.md b/docs/examples/kotlin/functions/delete-execution.md index eb1f59e..95994f8 100644 --- a/docs/examples/kotlin/functions/delete-execution.md +++ b/docs/examples/kotlin/functions/delete-execution.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/delete-variable.md b/docs/examples/kotlin/functions/delete-variable.md index 912e769..e179367 100644 --- a/docs/examples/kotlin/functions/delete-variable.md +++ b/docs/examples/kotlin/functions/delete-variable.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/delete.md b/docs/examples/kotlin/functions/delete.md index 97f0b00..9651744 100644 --- a/docs/examples/kotlin/functions/delete.md +++ b/docs/examples/kotlin/functions/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/get-deployment-download.md b/docs/examples/kotlin/functions/get-deployment-download.md index 13dec6a..634cfae 100644 --- a/docs/examples/kotlin/functions/get-deployment-download.md +++ b/docs/examples/kotlin/functions/get-deployment-download.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key @@ -11,5 +11,6 @@ val functions = Functions(client) val result = functions.getDeploymentDownload( functionId = "", - deploymentId = "" + deploymentId = "", + type = "source" // optional ) diff --git a/docs/examples/kotlin/functions/get-deployment.md b/docs/examples/kotlin/functions/get-deployment.md index e844328..eba4abb 100644 --- a/docs/examples/kotlin/functions/get-deployment.md +++ b/docs/examples/kotlin/functions/get-deployment.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/get-execution.md b/docs/examples/kotlin/functions/get-execution.md index 5f981bf..480dbb7 100644 --- a/docs/examples/kotlin/functions/get-execution.md +++ b/docs/examples/kotlin/functions/get-execution.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/functions/get-variable.md b/docs/examples/kotlin/functions/get-variable.md index 8d6ee38..95359ef 100644 --- a/docs/examples/kotlin/functions/get-variable.md +++ b/docs/examples/kotlin/functions/get-variable.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/get.md b/docs/examples/kotlin/functions/get.md index f56d8b9..162fa22 100644 --- a/docs/examples/kotlin/functions/get.md +++ b/docs/examples/kotlin/functions/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/list-deployments.md b/docs/examples/kotlin/functions/list-deployments.md index cf7deff..9318442 100644 --- a/docs/examples/kotlin/functions/list-deployments.md +++ b/docs/examples/kotlin/functions/list-deployments.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/list-executions.md b/docs/examples/kotlin/functions/list-executions.md index 8f4546c..926719c 100644 --- a/docs/examples/kotlin/functions/list-executions.md +++ b/docs/examples/kotlin/functions/list-executions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with @@ -11,6 +11,5 @@ val functions = Functions(client) val response = functions.listExecutions( functionId = "", - queries = listOf(), // optional - search = "" // optional + queries = listOf() // optional ) diff --git a/docs/examples/kotlin/functions/list-runtimes.md b/docs/examples/kotlin/functions/list-runtimes.md index a464156..5b3673b 100644 --- a/docs/examples/kotlin/functions/list-runtimes.md +++ b/docs/examples/kotlin/functions/list-runtimes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/list-specifications.md b/docs/examples/kotlin/functions/list-specifications.md index 8d86aa6..0b2fb46 100644 --- a/docs/examples/kotlin/functions/list-specifications.md +++ b/docs/examples/kotlin/functions/list-specifications.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/list-variables.md b/docs/examples/kotlin/functions/list-variables.md index 4876517..7f576e8 100644 --- a/docs/examples/kotlin/functions/list-variables.md +++ b/docs/examples/kotlin/functions/list-variables.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/list.md b/docs/examples/kotlin/functions/list.md index 9a58501..b10fdff 100644 --- a/docs/examples/kotlin/functions/list.md +++ b/docs/examples/kotlin/functions/list.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/functions/update-deployment-build.md b/docs/examples/kotlin/functions/update-deployment-status.md similarity index 73% rename from docs/examples/kotlin/functions/update-deployment-build.md rename to docs/examples/kotlin/functions/update-deployment-status.md index 6adb07a..0e6e9c0 100644 --- a/docs/examples/kotlin/functions/update-deployment-build.md +++ b/docs/examples/kotlin/functions/update-deployment-status.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val functions = Functions(client) -val response = functions.updateDeploymentBuild( +val response = functions.updateDeploymentStatus( functionId = "", deploymentId = "" ) diff --git a/docs/examples/kotlin/functions/update-deployment.md b/docs/examples/kotlin/functions/update-function-deployment.md similarity index 73% rename from docs/examples/kotlin/functions/update-deployment.md rename to docs/examples/kotlin/functions/update-function-deployment.md index fb95b08..a975e07 100644 --- a/docs/examples/kotlin/functions/update-deployment.md +++ b/docs/examples/kotlin/functions/update-function-deployment.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val functions = Functions(client) -val response = functions.updateDeployment( +val response = functions.updateFunctionDeployment( functionId = "", deploymentId = "" ) diff --git a/docs/examples/kotlin/functions/update-variable.md b/docs/examples/kotlin/functions/update-variable.md index db9438c..106b340 100644 --- a/docs/examples/kotlin/functions/update-variable.md +++ b/docs/examples/kotlin/functions/update-variable.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key @@ -13,5 +13,6 @@ val response = functions.updateVariable( functionId = "", variableId = "", key = "", - value = "" // optional + value = "", // optional + secret = false // optional ) diff --git a/docs/examples/kotlin/functions/update.md b/docs/examples/kotlin/functions/update.md index d36c761..7f0b33e 100644 --- a/docs/examples/kotlin/functions/update.md +++ b/docs/examples/kotlin/functions/update.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Functions val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/graphql/mutation.md b/docs/examples/kotlin/graphql/mutation.md index d4d2fd2..98081ab 100644 --- a/docs/examples/kotlin/graphql/mutation.md +++ b/docs/examples/kotlin/graphql/mutation.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Graphql val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/graphql/query.md b/docs/examples/kotlin/graphql/query.md index 79457c1..dec8dd3 100644 --- a/docs/examples/kotlin/graphql/query.md +++ b/docs/examples/kotlin/graphql/query.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Graphql val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-antivirus.md b/docs/examples/kotlin/health/get-antivirus.md index c840725..869b4c4 100644 --- a/docs/examples/kotlin/health/get-antivirus.md +++ b/docs/examples/kotlin/health/get-antivirus.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-cache.md b/docs/examples/kotlin/health/get-cache.md index 20ddb89..8b72ec4 100644 --- a/docs/examples/kotlin/health/get-cache.md +++ b/docs/examples/kotlin/health/get-cache.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-certificate.md b/docs/examples/kotlin/health/get-certificate.md index 714a270..74bf618 100644 --- a/docs/examples/kotlin/health/get-certificate.md +++ b/docs/examples/kotlin/health/get-certificate.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-d-b.md b/docs/examples/kotlin/health/get-db.md similarity index 79% rename from docs/examples/kotlin/health/get-d-b.md rename to docs/examples/kotlin/health/get-db.md index c707be3..a55a114 100644 --- a/docs/examples/kotlin/health/get-d-b.md +++ b/docs/examples/kotlin/health/get-db.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-failed-jobs.md b/docs/examples/kotlin/health/get-failed-jobs.md index 5c5497a..027df12 100644 --- a/docs/examples/kotlin/health/get-failed-jobs.md +++ b/docs/examples/kotlin/health/get-failed-jobs.md @@ -4,7 +4,7 @@ import io.appwrite.services.Health import io.appwrite.enums.Name val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-pub-sub.md b/docs/examples/kotlin/health/get-pub-sub.md index 8a69bc7..53c3820 100644 --- a/docs/examples/kotlin/health/get-pub-sub.md +++ b/docs/examples/kotlin/health/get-pub-sub.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-builds.md b/docs/examples/kotlin/health/get-queue-builds.md index 4d0cb3a..371aad9 100644 --- a/docs/examples/kotlin/health/get-queue-builds.md +++ b/docs/examples/kotlin/health/get-queue-builds.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-certificates.md b/docs/examples/kotlin/health/get-queue-certificates.md index 1b07df6..5c6adee 100644 --- a/docs/examples/kotlin/health/get-queue-certificates.md +++ b/docs/examples/kotlin/health/get-queue-certificates.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-databases.md b/docs/examples/kotlin/health/get-queue-databases.md index fb1dce6..3a34058 100644 --- a/docs/examples/kotlin/health/get-queue-databases.md +++ b/docs/examples/kotlin/health/get-queue-databases.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-deletes.md b/docs/examples/kotlin/health/get-queue-deletes.md index d3f1186..5d0b8a3 100644 --- a/docs/examples/kotlin/health/get-queue-deletes.md +++ b/docs/examples/kotlin/health/get-queue-deletes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-functions.md b/docs/examples/kotlin/health/get-queue-functions.md index 2a04595..7a42b61 100644 --- a/docs/examples/kotlin/health/get-queue-functions.md +++ b/docs/examples/kotlin/health/get-queue-functions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-logs.md b/docs/examples/kotlin/health/get-queue-logs.md index 6467a39..151025b 100644 --- a/docs/examples/kotlin/health/get-queue-logs.md +++ b/docs/examples/kotlin/health/get-queue-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-mails.md b/docs/examples/kotlin/health/get-queue-mails.md index 143dc40..f5a905d 100644 --- a/docs/examples/kotlin/health/get-queue-mails.md +++ b/docs/examples/kotlin/health/get-queue-mails.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-messaging.md b/docs/examples/kotlin/health/get-queue-messaging.md index e85e425..4a83792 100644 --- a/docs/examples/kotlin/health/get-queue-messaging.md +++ b/docs/examples/kotlin/health/get-queue-messaging.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-migrations.md b/docs/examples/kotlin/health/get-queue-migrations.md index f287e78..853d294 100644 --- a/docs/examples/kotlin/health/get-queue-migrations.md +++ b/docs/examples/kotlin/health/get-queue-migrations.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-usage-dump.md b/docs/examples/kotlin/health/get-queue-stats-resources.md similarity index 70% rename from docs/examples/kotlin/health/get-queue-usage-dump.md rename to docs/examples/kotlin/health/get-queue-stats-resources.md index a1b1a30..6a76f52 100644 --- a/docs/examples/kotlin/health/get-queue-usage-dump.md +++ b/docs/examples/kotlin/health/get-queue-stats-resources.md @@ -3,12 +3,12 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val health = Health(client) -val response = health.getQueueUsageDump( +val response = health.getQueueStatsResources( threshold = 0 // optional ) diff --git a/docs/examples/kotlin/health/get-queue-usage.md b/docs/examples/kotlin/health/get-queue-usage.md index fcfcf10..e344b9e 100644 --- a/docs/examples/kotlin/health/get-queue-usage.md +++ b/docs/examples/kotlin/health/get-queue-usage.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-queue-webhooks.md b/docs/examples/kotlin/health/get-queue-webhooks.md index 6452f1a..f5ffc58 100644 --- a/docs/examples/kotlin/health/get-queue-webhooks.md +++ b/docs/examples/kotlin/health/get-queue-webhooks.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-storage-local.md b/docs/examples/kotlin/health/get-storage-local.md index b2c9987..32a21ae 100644 --- a/docs/examples/kotlin/health/get-storage-local.md +++ b/docs/examples/kotlin/health/get-storage-local.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-storage.md b/docs/examples/kotlin/health/get-storage.md index 7038ee2..8af609a 100644 --- a/docs/examples/kotlin/health/get-storage.md +++ b/docs/examples/kotlin/health/get-storage.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get-time.md b/docs/examples/kotlin/health/get-time.md index 7c50ae4..8054ed7 100644 --- a/docs/examples/kotlin/health/get-time.md +++ b/docs/examples/kotlin/health/get-time.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/health/get.md b/docs/examples/kotlin/health/get.md index c53445f..0845320 100644 --- a/docs/examples/kotlin/health/get.md +++ b/docs/examples/kotlin/health/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Health val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/locale/get.md b/docs/examples/kotlin/locale/get.md index b8dc768..6840259 100644 --- a/docs/examples/kotlin/locale/get.md +++ b/docs/examples/kotlin/locale/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Locale val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/locale/list-codes.md b/docs/examples/kotlin/locale/list-codes.md index 784e688..fd0c4e4 100644 --- a/docs/examples/kotlin/locale/list-codes.md +++ b/docs/examples/kotlin/locale/list-codes.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Locale val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/locale/list-continents.md b/docs/examples/kotlin/locale/list-continents.md index 6cad16e..699d599 100644 --- a/docs/examples/kotlin/locale/list-continents.md +++ b/docs/examples/kotlin/locale/list-continents.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Locale val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/locale/list-countries-e-u.md b/docs/examples/kotlin/locale/list-countries-eu.md similarity index 80% rename from docs/examples/kotlin/locale/list-countries-e-u.md rename to docs/examples/kotlin/locale/list-countries-eu.md index cfec468..13e86f3 100644 --- a/docs/examples/kotlin/locale/list-countries-e-u.md +++ b/docs/examples/kotlin/locale/list-countries-eu.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Locale val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/locale/list-countries-phones.md b/docs/examples/kotlin/locale/list-countries-phones.md index 06585ad..b660ccf 100644 --- a/docs/examples/kotlin/locale/list-countries-phones.md +++ b/docs/examples/kotlin/locale/list-countries-phones.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Locale val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/locale/list-countries.md b/docs/examples/kotlin/locale/list-countries.md index 7789bbe..3457ceb 100644 --- a/docs/examples/kotlin/locale/list-countries.md +++ b/docs/examples/kotlin/locale/list-countries.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Locale val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/locale/list-currencies.md b/docs/examples/kotlin/locale/list-currencies.md index 6c7f709..80b2cc7 100644 --- a/docs/examples/kotlin/locale/list-currencies.md +++ b/docs/examples/kotlin/locale/list-currencies.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Locale val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/locale/list-languages.md b/docs/examples/kotlin/locale/list-languages.md index a20096e..b36c138 100644 --- a/docs/examples/kotlin/locale/list-languages.md +++ b/docs/examples/kotlin/locale/list-languages.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Locale val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/messaging/create-apns-provider.md b/docs/examples/kotlin/messaging/create-apns-provider.md index 8a58fe8..5104edf 100644 --- a/docs/examples/kotlin/messaging/create-apns-provider.md +++ b/docs/examples/kotlin/messaging/create-apns-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val messaging = Messaging(client) -val response = messaging.createApnsProvider( +val response = messaging.createAPNSProvider( providerId = "", name = "", authKey = "", // optional diff --git a/docs/examples/kotlin/messaging/create-email.md b/docs/examples/kotlin/messaging/create-email.md index 02b0651..f0f41e9 100644 --- a/docs/examples/kotlin/messaging/create-email.md +++ b/docs/examples/kotlin/messaging/create-email.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-fcm-provider.md b/docs/examples/kotlin/messaging/create-fcm-provider.md index 779596c..b1a2ef8 100644 --- a/docs/examples/kotlin/messaging/create-fcm-provider.md +++ b/docs/examples/kotlin/messaging/create-fcm-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val messaging = Messaging(client) -val response = messaging.createFcmProvider( +val response = messaging.createFCMProvider( providerId = "", name = "", serviceAccountJSON = mapOf( "a" to "b" ), // optional diff --git a/docs/examples/kotlin/messaging/create-mailgun-provider.md b/docs/examples/kotlin/messaging/create-mailgun-provider.md index a73a27f..d205171 100644 --- a/docs/examples/kotlin/messaging/create-mailgun-provider.md +++ b/docs/examples/kotlin/messaging/create-mailgun-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-msg91provider.md b/docs/examples/kotlin/messaging/create-msg-91-provider.md similarity index 87% rename from docs/examples/kotlin/messaging/create-msg91provider.md rename to docs/examples/kotlin/messaging/create-msg-91-provider.md index 31eb606..5ea3d22 100644 --- a/docs/examples/kotlin/messaging/create-msg91provider.md +++ b/docs/examples/kotlin/messaging/create-msg-91-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-push.md b/docs/examples/kotlin/messaging/create-push.md index f92a49d..5b07f53 100644 --- a/docs/examples/kotlin/messaging/create-push.md +++ b/docs/examples/kotlin/messaging/create-push.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-sendgrid-provider.md b/docs/examples/kotlin/messaging/create-sendgrid-provider.md index 34f61c9..e96a052 100644 --- a/docs/examples/kotlin/messaging/create-sendgrid-provider.md +++ b/docs/examples/kotlin/messaging/create-sendgrid-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-sms.md b/docs/examples/kotlin/messaging/create-sms.md index 6fbcffb..54c06eb 100644 --- a/docs/examples/kotlin/messaging/create-sms.md +++ b/docs/examples/kotlin/messaging/create-sms.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val messaging = Messaging(client) -val response = messaging.createSms( +val response = messaging.createSMS( messageId = "", content = "", topics = listOf(), // optional diff --git a/docs/examples/kotlin/messaging/create-smtp-provider.md b/docs/examples/kotlin/messaging/create-smtp-provider.md index 17643dc..ce50130 100644 --- a/docs/examples/kotlin/messaging/create-smtp-provider.md +++ b/docs/examples/kotlin/messaging/create-smtp-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val messaging = Messaging(client) -val response = messaging.createSmtpProvider( +val response = messaging.createSMTPProvider( providerId = "", name = "", host = "", diff --git a/docs/examples/kotlin/messaging/create-subscriber.md b/docs/examples/kotlin/messaging/create-subscriber.md index 805cd58..44e3a72 100644 --- a/docs/examples/kotlin/messaging/create-subscriber.md +++ b/docs/examples/kotlin/messaging/create-subscriber.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setJWT("") // Your secret JSON Web Token diff --git a/docs/examples/kotlin/messaging/create-telesign-provider.md b/docs/examples/kotlin/messaging/create-telesign-provider.md index 1d44fca..cddd6d8 100644 --- a/docs/examples/kotlin/messaging/create-telesign-provider.md +++ b/docs/examples/kotlin/messaging/create-telesign-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-textmagic-provider.md b/docs/examples/kotlin/messaging/create-textmagic-provider.md index d88b9bb..12eb62d 100644 --- a/docs/examples/kotlin/messaging/create-textmagic-provider.md +++ b/docs/examples/kotlin/messaging/create-textmagic-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-topic.md b/docs/examples/kotlin/messaging/create-topic.md index 6a6b9bd..570be33 100644 --- a/docs/examples/kotlin/messaging/create-topic.md +++ b/docs/examples/kotlin/messaging/create-topic.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-twilio-provider.md b/docs/examples/kotlin/messaging/create-twilio-provider.md index 3df99e9..c05b835 100644 --- a/docs/examples/kotlin/messaging/create-twilio-provider.md +++ b/docs/examples/kotlin/messaging/create-twilio-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/create-vonage-provider.md b/docs/examples/kotlin/messaging/create-vonage-provider.md index 59e5d14..7e049d8 100644 --- a/docs/examples/kotlin/messaging/create-vonage-provider.md +++ b/docs/examples/kotlin/messaging/create-vonage-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/delete-provider.md b/docs/examples/kotlin/messaging/delete-provider.md index 3ecd64d..4989da8 100644 --- a/docs/examples/kotlin/messaging/delete-provider.md +++ b/docs/examples/kotlin/messaging/delete-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/delete-subscriber.md b/docs/examples/kotlin/messaging/delete-subscriber.md index 4a7c18f..0f99f25 100644 --- a/docs/examples/kotlin/messaging/delete-subscriber.md +++ b/docs/examples/kotlin/messaging/delete-subscriber.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setJWT("") // Your secret JSON Web Token diff --git a/docs/examples/kotlin/messaging/delete-topic.md b/docs/examples/kotlin/messaging/delete-topic.md index 4859c0a..8a52c9f 100644 --- a/docs/examples/kotlin/messaging/delete-topic.md +++ b/docs/examples/kotlin/messaging/delete-topic.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/delete.md b/docs/examples/kotlin/messaging/delete.md index 0b925ca..7e4ec51 100644 --- a/docs/examples/kotlin/messaging/delete.md +++ b/docs/examples/kotlin/messaging/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/get-message.md b/docs/examples/kotlin/messaging/get-message.md index 01db389..710d356 100644 --- a/docs/examples/kotlin/messaging/get-message.md +++ b/docs/examples/kotlin/messaging/get-message.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/get-provider.md b/docs/examples/kotlin/messaging/get-provider.md index 53e5cf3..c678d4d 100644 --- a/docs/examples/kotlin/messaging/get-provider.md +++ b/docs/examples/kotlin/messaging/get-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/get-subscriber.md b/docs/examples/kotlin/messaging/get-subscriber.md index 036f17f..59b335a 100644 --- a/docs/examples/kotlin/messaging/get-subscriber.md +++ b/docs/examples/kotlin/messaging/get-subscriber.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/get-topic.md b/docs/examples/kotlin/messaging/get-topic.md index 09d3688..c189898 100644 --- a/docs/examples/kotlin/messaging/get-topic.md +++ b/docs/examples/kotlin/messaging/get-topic.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-message-logs.md b/docs/examples/kotlin/messaging/list-message-logs.md index 3048904..e1463f8 100644 --- a/docs/examples/kotlin/messaging/list-message-logs.md +++ b/docs/examples/kotlin/messaging/list-message-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-messages.md b/docs/examples/kotlin/messaging/list-messages.md index e9e509e..618f8c4 100644 --- a/docs/examples/kotlin/messaging/list-messages.md +++ b/docs/examples/kotlin/messaging/list-messages.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-provider-logs.md b/docs/examples/kotlin/messaging/list-provider-logs.md index e0a52cb..ab0a9f1 100644 --- a/docs/examples/kotlin/messaging/list-provider-logs.md +++ b/docs/examples/kotlin/messaging/list-provider-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-providers.md b/docs/examples/kotlin/messaging/list-providers.md index 66439e2..34c70a9 100644 --- a/docs/examples/kotlin/messaging/list-providers.md +++ b/docs/examples/kotlin/messaging/list-providers.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-subscriber-logs.md b/docs/examples/kotlin/messaging/list-subscriber-logs.md index 5472d5f..8a82af8 100644 --- a/docs/examples/kotlin/messaging/list-subscriber-logs.md +++ b/docs/examples/kotlin/messaging/list-subscriber-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-subscribers.md b/docs/examples/kotlin/messaging/list-subscribers.md index a95e854..acf5249 100644 --- a/docs/examples/kotlin/messaging/list-subscribers.md +++ b/docs/examples/kotlin/messaging/list-subscribers.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-targets.md b/docs/examples/kotlin/messaging/list-targets.md index a99e822..ad500f0 100644 --- a/docs/examples/kotlin/messaging/list-targets.md +++ b/docs/examples/kotlin/messaging/list-targets.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-topic-logs.md b/docs/examples/kotlin/messaging/list-topic-logs.md index 7b7d2f0..683b418 100644 --- a/docs/examples/kotlin/messaging/list-topic-logs.md +++ b/docs/examples/kotlin/messaging/list-topic-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/list-topics.md b/docs/examples/kotlin/messaging/list-topics.md index 4550f1e..125c6ff 100644 --- a/docs/examples/kotlin/messaging/list-topics.md +++ b/docs/examples/kotlin/messaging/list-topics.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-apns-provider.md b/docs/examples/kotlin/messaging/update-apns-provider.md index 83a6083..29b436e 100644 --- a/docs/examples/kotlin/messaging/update-apns-provider.md +++ b/docs/examples/kotlin/messaging/update-apns-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val messaging = Messaging(client) -val response = messaging.updateApnsProvider( +val response = messaging.updateAPNSProvider( providerId = "", name = "", // optional enabled = false, // optional diff --git a/docs/examples/kotlin/messaging/update-email.md b/docs/examples/kotlin/messaging/update-email.md index 29baf18..cd74bb4 100644 --- a/docs/examples/kotlin/messaging/update-email.md +++ b/docs/examples/kotlin/messaging/update-email.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-fcm-provider.md b/docs/examples/kotlin/messaging/update-fcm-provider.md index 4d8534c..84e5635 100644 --- a/docs/examples/kotlin/messaging/update-fcm-provider.md +++ b/docs/examples/kotlin/messaging/update-fcm-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val messaging = Messaging(client) -val response = messaging.updateFcmProvider( +val response = messaging.updateFCMProvider( providerId = "", name = "", // optional enabled = false, // optional diff --git a/docs/examples/kotlin/messaging/update-mailgun-provider.md b/docs/examples/kotlin/messaging/update-mailgun-provider.md index 9caff42..4bec8d2 100644 --- a/docs/examples/kotlin/messaging/update-mailgun-provider.md +++ b/docs/examples/kotlin/messaging/update-mailgun-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-msg91provider.md b/docs/examples/kotlin/messaging/update-msg-91-provider.md similarity index 87% rename from docs/examples/kotlin/messaging/update-msg91provider.md rename to docs/examples/kotlin/messaging/update-msg-91-provider.md index 1a6a0b4..3abaca7 100644 --- a/docs/examples/kotlin/messaging/update-msg91provider.md +++ b/docs/examples/kotlin/messaging/update-msg-91-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-push.md b/docs/examples/kotlin/messaging/update-push.md index 0ba72c4..710a37e 100644 --- a/docs/examples/kotlin/messaging/update-push.md +++ b/docs/examples/kotlin/messaging/update-push.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-sendgrid-provider.md b/docs/examples/kotlin/messaging/update-sendgrid-provider.md index 353cbd0..962aa69 100644 --- a/docs/examples/kotlin/messaging/update-sendgrid-provider.md +++ b/docs/examples/kotlin/messaging/update-sendgrid-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-sms.md b/docs/examples/kotlin/messaging/update-sms.md index 7f008e8..534e9ad 100644 --- a/docs/examples/kotlin/messaging/update-sms.md +++ b/docs/examples/kotlin/messaging/update-sms.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val messaging = Messaging(client) -val response = messaging.updateSms( +val response = messaging.updateSMS( messageId = "", topics = listOf(), // optional users = listOf(), // optional diff --git a/docs/examples/kotlin/messaging/update-smtp-provider.md b/docs/examples/kotlin/messaging/update-smtp-provider.md index 465d76b..7652e53 100644 --- a/docs/examples/kotlin/messaging/update-smtp-provider.md +++ b/docs/examples/kotlin/messaging/update-smtp-provider.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val messaging = Messaging(client) -val response = messaging.updateSmtpProvider( +val response = messaging.updateSMTPProvider( providerId = "", name = "", // optional host = "", // optional diff --git a/docs/examples/kotlin/messaging/update-telesign-provider.md b/docs/examples/kotlin/messaging/update-telesign-provider.md index 9a4d93e..83fb11a 100644 --- a/docs/examples/kotlin/messaging/update-telesign-provider.md +++ b/docs/examples/kotlin/messaging/update-telesign-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-textmagic-provider.md b/docs/examples/kotlin/messaging/update-textmagic-provider.md index 14e8ac5..1e2ee1e 100644 --- a/docs/examples/kotlin/messaging/update-textmagic-provider.md +++ b/docs/examples/kotlin/messaging/update-textmagic-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-topic.md b/docs/examples/kotlin/messaging/update-topic.md index 68e8949..0991fd0 100644 --- a/docs/examples/kotlin/messaging/update-topic.md +++ b/docs/examples/kotlin/messaging/update-topic.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-twilio-provider.md b/docs/examples/kotlin/messaging/update-twilio-provider.md index 2c7a5e8..1c86f9e 100644 --- a/docs/examples/kotlin/messaging/update-twilio-provider.md +++ b/docs/examples/kotlin/messaging/update-twilio-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/messaging/update-vonage-provider.md b/docs/examples/kotlin/messaging/update-vonage-provider.md index 4d432f7..bf0ee2b 100644 --- a/docs/examples/kotlin/messaging/update-vonage-provider.md +++ b/docs/examples/kotlin/messaging/update-vonage-provider.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Messaging val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/sites/create-deployment.md b/docs/examples/kotlin/sites/create-deployment.md new file mode 100644 index 0000000..ba2c24d --- /dev/null +++ b/docs/examples/kotlin/sites/create-deployment.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.models.InputFile +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.createDeployment( + siteId = "", + code = InputFile.fromPath("file.png"), + activate = false, + installCommand = "", // optional + buildCommand = "", // optional + outputDirectory = "" // optional +) diff --git a/docs/examples/kotlin/sites/create-duplicate-deployment.md b/docs/examples/kotlin/sites/create-duplicate-deployment.md new file mode 100644 index 0000000..06a3ce8 --- /dev/null +++ b/docs/examples/kotlin/sites/create-duplicate-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.createDuplicateDeployment( + siteId = "", + deploymentId = "" +) diff --git a/docs/examples/kotlin/sites/create-template-deployment.md b/docs/examples/kotlin/sites/create-template-deployment.md new file mode 100644 index 0000000..bf246be --- /dev/null +++ b/docs/examples/kotlin/sites/create-template-deployment.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.createTemplateDeployment( + siteId = "", + repository = "", + owner = "", + rootDirectory = "", + version = "", + activate = false // optional +) diff --git a/docs/examples/kotlin/sites/create-variable.md b/docs/examples/kotlin/sites/create-variable.md new file mode 100644 index 0000000..6eb4666 --- /dev/null +++ b/docs/examples/kotlin/sites/create-variable.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.createVariable( + siteId = "", + key = "", + value = "", + secret = false // optional +) diff --git a/docs/examples/kotlin/sites/create-vcs-deployment.md b/docs/examples/kotlin/sites/create-vcs-deployment.md new file mode 100644 index 0000000..141cf3e --- /dev/null +++ b/docs/examples/kotlin/sites/create-vcs-deployment.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.VCSDeploymentType + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.createVcsDeployment( + siteId = "", + type = VCSDeploymentType.BRANCH, + reference = "", + activate = false // optional +) diff --git a/docs/examples/kotlin/sites/create.md b/docs/examples/kotlin/sites/create.md new file mode 100644 index 0000000..a5e9719 --- /dev/null +++ b/docs/examples/kotlin/sites/create.md @@ -0,0 +1,33 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.Framework +import io.appwrite.enums.BuildRuntime + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.create( + siteId = "", + name = "", + framework = .ANALOG, + buildRuntime = .NODE_14_5, + enabled = false, // optional + logging = false, // optional + timeout = 1, // optional + installCommand = "", // optional + buildCommand = "", // optional + outputDirectory = "", // optional + adapter = "static", // optional + installationId = "", // optional + fallbackFile = "", // optional + providerRepositoryId = "", // optional + providerBranch = "", // optional + providerSilentMode = false, // optional + providerRootDirectory = "", // optional + specification = "" // optional +) diff --git a/docs/examples/kotlin/sites/delete-deployment.md b/docs/examples/kotlin/sites/delete-deployment.md new file mode 100644 index 0000000..6d73918 --- /dev/null +++ b/docs/examples/kotlin/sites/delete-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteDeployment( + siteId = "", + deploymentId = "" +) diff --git a/docs/examples/kotlin/sites/delete-log.md b/docs/examples/kotlin/sites/delete-log.md new file mode 100644 index 0000000..c7d7b77 --- /dev/null +++ b/docs/examples/kotlin/sites/delete-log.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteLog( + siteId = "", + logId = "" +) diff --git a/docs/examples/kotlin/sites/delete-variable.md b/docs/examples/kotlin/sites/delete-variable.md new file mode 100644 index 0000000..7859a8a --- /dev/null +++ b/docs/examples/kotlin/sites/delete-variable.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.deleteVariable( + siteId = "", + variableId = "" +) diff --git a/docs/examples/kotlin/sites/delete.md b/docs/examples/kotlin/sites/delete.md new file mode 100644 index 0000000..369b614 --- /dev/null +++ b/docs/examples/kotlin/sites/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.delete( + siteId = "" +) diff --git a/docs/examples/kotlin/sites/get-deployment-download.md b/docs/examples/kotlin/sites/get-deployment-download.md new file mode 100644 index 0000000..8432476 --- /dev/null +++ b/docs/examples/kotlin/sites/get-deployment-download.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val result = sites.getDeploymentDownload( + siteId = "", + deploymentId = "", + type = "source" // optional +) diff --git a/docs/examples/kotlin/sites/get-deployment.md b/docs/examples/kotlin/sites/get-deployment.md new file mode 100644 index 0000000..f2a33a4 --- /dev/null +++ b/docs/examples/kotlin/sites/get-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.getDeployment( + siteId = "", + deploymentId = "" +) diff --git a/docs/examples/kotlin/sites/get-log.md b/docs/examples/kotlin/sites/get-log.md new file mode 100644 index 0000000..ff46f77 --- /dev/null +++ b/docs/examples/kotlin/sites/get-log.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.getLog( + siteId = "", + logId = "" +) diff --git a/docs/examples/kotlin/sites/get-variable.md b/docs/examples/kotlin/sites/get-variable.md new file mode 100644 index 0000000..ccab666 --- /dev/null +++ b/docs/examples/kotlin/sites/get-variable.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.getVariable( + siteId = "", + variableId = "" +) diff --git a/docs/examples/kotlin/sites/get.md b/docs/examples/kotlin/sites/get.md new file mode 100644 index 0000000..7ced974 --- /dev/null +++ b/docs/examples/kotlin/sites/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.get( + siteId = "" +) diff --git a/docs/examples/kotlin/sites/list-deployments.md b/docs/examples/kotlin/sites/list-deployments.md new file mode 100644 index 0000000..6bc29cc --- /dev/null +++ b/docs/examples/kotlin/sites/list-deployments.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.listDeployments( + siteId = "", + queries = listOf(), // optional + search = "" // optional +) diff --git a/docs/examples/kotlin/health/get-queue.md b/docs/examples/kotlin/sites/list-frameworks.md similarity index 54% rename from docs/examples/kotlin/health/get-queue.md rename to docs/examples/kotlin/sites/list-frameworks.md index d24e8c4..cf02b75 100644 --- a/docs/examples/kotlin/health/get-queue.md +++ b/docs/examples/kotlin/sites/list-frameworks.md @@ -1,12 +1,12 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback -import io.appwrite.services.Health +import io.appwrite.services.Sites val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key -val health = Health(client) +val sites = Sites(client) -val response = health.getQueue() +val response = sites.listFrameworks() diff --git a/docs/examples/kotlin/sites/list-logs.md b/docs/examples/kotlin/sites/list-logs.md new file mode 100644 index 0000000..d7979de --- /dev/null +++ b/docs/examples/kotlin/sites/list-logs.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.listLogs( + siteId = "", + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/sites/list-specifications.md b/docs/examples/kotlin/sites/list-specifications.md new file mode 100644 index 0000000..56e8640 --- /dev/null +++ b/docs/examples/kotlin/sites/list-specifications.md @@ -0,0 +1,12 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.listSpecifications() diff --git a/docs/examples/kotlin/sites/list-variables.md b/docs/examples/kotlin/sites/list-variables.md new file mode 100644 index 0000000..70ec497 --- /dev/null +++ b/docs/examples/kotlin/sites/list-variables.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.listVariables( + siteId = "" +) diff --git a/docs/examples/kotlin/sites/list.md b/docs/examples/kotlin/sites/list.md new file mode 100644 index 0000000..26e9651 --- /dev/null +++ b/docs/examples/kotlin/sites/list.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.list( + queries = listOf(), // optional + search = "" // optional +) diff --git a/docs/examples/kotlin/sites/update-deployment-status.md b/docs/examples/kotlin/sites/update-deployment-status.md new file mode 100644 index 0000000..585fc32 --- /dev/null +++ b/docs/examples/kotlin/sites/update-deployment-status.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateDeploymentStatus( + siteId = "", + deploymentId = "" +) diff --git a/docs/examples/kotlin/sites/update-site-deployment.md b/docs/examples/kotlin/sites/update-site-deployment.md new file mode 100644 index 0000000..fb9bb72 --- /dev/null +++ b/docs/examples/kotlin/sites/update-site-deployment.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateSiteDeployment( + siteId = "", + deploymentId = "" +) diff --git a/docs/examples/kotlin/sites/update-variable.md b/docs/examples/kotlin/sites/update-variable.md new file mode 100644 index 0000000..b32c278 --- /dev/null +++ b/docs/examples/kotlin/sites/update-variable.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.updateVariable( + siteId = "", + variableId = "", + key = "", + value = "", // optional + secret = false // optional +) diff --git a/docs/examples/kotlin/sites/update.md b/docs/examples/kotlin/sites/update.md new file mode 100644 index 0000000..4b4a938 --- /dev/null +++ b/docs/examples/kotlin/sites/update.md @@ -0,0 +1,32 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Sites +import io.appwrite.enums.Framework + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val sites = Sites(client) + +val response = sites.update( + siteId = "", + name = "", + framework = .ANALOG, + enabled = false, // optional + logging = false, // optional + timeout = 1, // optional + installCommand = "", // optional + buildCommand = "", // optional + outputDirectory = "", // optional + buildRuntime = "node-14.5", // optional + adapter = "static", // optional + fallbackFile = "", // optional + installationId = "", // optional + providerRepositoryId = "", // optional + providerBranch = "", // optional + providerSilentMode = false, // optional + providerRootDirectory = "", // optional + specification = "" // optional +) diff --git a/docs/examples/kotlin/storage/create-bucket.md b/docs/examples/kotlin/storage/create-bucket.md index 0c0119e..0bca827 100644 --- a/docs/examples/kotlin/storage/create-bucket.md +++ b/docs/examples/kotlin/storage/create-bucket.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/storage/create-file.md b/docs/examples/kotlin/storage/create-file.md index a2203ff..b22b32a 100644 --- a/docs/examples/kotlin/storage/create-file.md +++ b/docs/examples/kotlin/storage/create-file.md @@ -4,7 +4,7 @@ import io.appwrite.models.InputFile import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/storage/delete-bucket.md b/docs/examples/kotlin/storage/delete-bucket.md index 2298103..4a0904e 100644 --- a/docs/examples/kotlin/storage/delete-bucket.md +++ b/docs/examples/kotlin/storage/delete-bucket.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/storage/delete-file.md b/docs/examples/kotlin/storage/delete-file.md index 5b17c5c..cf5e285 100644 --- a/docs/examples/kotlin/storage/delete-file.md +++ b/docs/examples/kotlin/storage/delete-file.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/storage/get-bucket.md b/docs/examples/kotlin/storage/get-bucket.md index 604ec05..e2a6a8f 100644 --- a/docs/examples/kotlin/storage/get-bucket.md +++ b/docs/examples/kotlin/storage/get-bucket.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/storage/get-file-download.md b/docs/examples/kotlin/storage/get-file-download.md index 46b02e7..c14c966 100644 --- a/docs/examples/kotlin/storage/get-file-download.md +++ b/docs/examples/kotlin/storage/get-file-download.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with @@ -11,5 +11,6 @@ val storage = Storage(client) val result = storage.getFileDownload( bucketId = "", - fileId = "" + fileId = "", + token = "" // optional ) diff --git a/docs/examples/kotlin/storage/get-file-preview.md b/docs/examples/kotlin/storage/get-file-preview.md index 88be42f..45122de 100644 --- a/docs/examples/kotlin/storage/get-file-preview.md +++ b/docs/examples/kotlin/storage/get-file-preview.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with @@ -15,12 +15,13 @@ val result = storage.getFilePreview( width = 0, // optional height = 0, // optional gravity = "center", // optional - quality = 0, // optional + quality = -1, // optional borderWidth = 0, // optional borderColor = "", // optional borderRadius = 0, // optional opacity = 0, // optional rotation = -360, // optional background = "", // optional - output = "jpg" // optional + output = "jpg", // optional + token = "" // optional ) diff --git a/docs/examples/kotlin/storage/get-file-view.md b/docs/examples/kotlin/storage/get-file-view.md index b4ad81f..fec1ec7 100644 --- a/docs/examples/kotlin/storage/get-file-view.md +++ b/docs/examples/kotlin/storage/get-file-view.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with @@ -11,5 +11,6 @@ val storage = Storage(client) val result = storage.getFileView( bucketId = "", - fileId = "" + fileId = "", + token = "" // optional ) diff --git a/docs/examples/kotlin/storage/get-file.md b/docs/examples/kotlin/storage/get-file.md index a6d2d3d..a807177 100644 --- a/docs/examples/kotlin/storage/get-file.md +++ b/docs/examples/kotlin/storage/get-file.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/storage/list-buckets.md b/docs/examples/kotlin/storage/list-buckets.md index 4b22970..a8a066d 100644 --- a/docs/examples/kotlin/storage/list-buckets.md +++ b/docs/examples/kotlin/storage/list-buckets.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/storage/list-files.md b/docs/examples/kotlin/storage/list-files.md index e7c3d66..cb9a776 100644 --- a/docs/examples/kotlin/storage/list-files.md +++ b/docs/examples/kotlin/storage/list-files.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/storage/update-bucket.md b/docs/examples/kotlin/storage/update-bucket.md index 4040dfb..d475a6e 100644 --- a/docs/examples/kotlin/storage/update-bucket.md +++ b/docs/examples/kotlin/storage/update-bucket.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/storage/update-file.md b/docs/examples/kotlin/storage/update-file.md index 96d4b08..e82ea81 100644 --- a/docs/examples/kotlin/storage/update-file.md +++ b/docs/examples/kotlin/storage/update-file.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/tablesdb/create-boolean-column.md b/docs/examples/kotlin/tablesdb/create-boolean-column.md new file mode 100644 index 0000000..fac14d9 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-boolean-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createBooleanColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = false, // optional + array = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-datetime-column.md b/docs/examples/kotlin/tablesdb/create-datetime-column.md new file mode 100644 index 0000000..e40d8e4 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-datetime-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createDatetimeColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "", // optional + array = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-email-column.md b/docs/examples/kotlin/tablesdb/create-email-column.md new file mode 100644 index 0000000..e93e0b8 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-email-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createEmailColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "email@example.com", // optional + array = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-enum-column.md b/docs/examples/kotlin/tablesdb/create-enum-column.md new file mode 100644 index 0000000..1d19a58 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-enum-column.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createEnumColumn( + databaseId = "", + tableId = "", + key = "", + elements = listOf(), + required = false, + default = "", // optional + array = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-float-column.md b/docs/examples/kotlin/tablesdb/create-float-column.md new file mode 100644 index 0000000..3c24b0d --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-float-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createFloatColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + min = 0, // optional + max = 0, // optional + default = 0, // optional + array = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-index.md b/docs/examples/kotlin/tablesdb/create-index.md new file mode 100644 index 0000000..2492f71 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-index.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.enums.IndexType + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIndex( + databaseId = "", + tableId = "", + key = "", + type = IndexType.KEY, + columns = listOf(), + orders = listOf(), // optional + lengths = listOf() // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-integer-column.md b/docs/examples/kotlin/tablesdb/create-integer-column.md new file mode 100644 index 0000000..90c558c --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-integer-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIntegerColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + min = 0, // optional + max = 0, // optional + default = 0, // optional + array = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-ip-column.md b/docs/examples/kotlin/tablesdb/create-ip-column.md new file mode 100644 index 0000000..81412c7 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-ip-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createIpColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "", // optional + array = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-relationship-column.md b/docs/examples/kotlin/tablesdb/create-relationship-column.md new file mode 100644 index 0000000..fbdf365 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-relationship-column.md @@ -0,0 +1,22 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB +import io.appwrite.enums.RelationshipType + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRelationshipColumn( + databaseId = "", + tableId = "", + relatedTableId = "", + type = RelationshipType.ONETOONE, + twoWay = false, // optional + key = "", // optional + twoWayKey = "", // optional + onDelete = "cascade" // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-row.md b/docs/examples/kotlin/tablesdb/create-row.md new file mode 100644 index 0000000..6a5b188 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-row.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRow( + databaseId = "", + tableId = "", + rowId = "", + data = mapOf( "a" to "b" ), + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-rows.md b/docs/examples/kotlin/tablesdb/create-rows.md new file mode 100644 index 0000000..1da47b5 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-rows.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createRows( + databaseId = "", + tableId = "", + rows = listOf() +) diff --git a/docs/examples/kotlin/tablesdb/create-string-column.md b/docs/examples/kotlin/tablesdb/create-string-column.md new file mode 100644 index 0000000..5b5d88d --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-string-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createStringColumn( + databaseId = "", + tableId = "", + key = "", + size = 1, + required = false, + default = "", // optional + array = false, // optional + encrypt = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-table.md b/docs/examples/kotlin/tablesdb/create-table.md new file mode 100644 index 0000000..88b50d2 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-table.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createTable( + databaseId = "", + tableId = "", + name = "", + permissions = listOf("read("any")"), // optional + rowSecurity = false, // optional + enabled = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create-url-column.md b/docs/examples/kotlin/tablesdb/create-url-column.md new file mode 100644 index 0000000..a0351e4 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create-url-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.createUrlColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "https://example.com", // optional + array = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/create.md b/docs/examples/kotlin/tablesdb/create.md new file mode 100644 index 0000000..4b025b8 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/create.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.create( + databaseId = "", + name = "", + enabled = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/decrement-row-column.md b/docs/examples/kotlin/tablesdb/decrement-row-column.md new file mode 100644 index 0000000..e284ec3 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/decrement-row-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.decrementRowColumn( + databaseId = "", + tableId = "", + rowId = "", + column = "", + value = 0, // optional + min = 0 // optional +) diff --git a/docs/examples/kotlin/tablesdb/delete-column.md b/docs/examples/kotlin/tablesdb/delete-column.md new file mode 100644 index 0000000..05d341d --- /dev/null +++ b/docs/examples/kotlin/tablesdb/delete-column.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteColumn( + databaseId = "", + tableId = "", + key = "" +) diff --git a/docs/examples/kotlin/tablesdb/delete-index.md b/docs/examples/kotlin/tablesdb/delete-index.md new file mode 100644 index 0000000..b5f2330 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/delete-index.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteIndex( + databaseId = "", + tableId = "", + key = "" +) diff --git a/docs/examples/kotlin/tablesdb/delete-row.md b/docs/examples/kotlin/tablesdb/delete-row.md new file mode 100644 index 0000000..f24b935 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/delete-row.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteRow( + databaseId = "", + tableId = "", + rowId = "" +) diff --git a/docs/examples/kotlin/tablesdb/delete-rows.md b/docs/examples/kotlin/tablesdb/delete-rows.md new file mode 100644 index 0000000..c915a5c --- /dev/null +++ b/docs/examples/kotlin/tablesdb/delete-rows.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteRows( + databaseId = "", + tableId = "", + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/tablesdb/delete-table.md b/docs/examples/kotlin/tablesdb/delete-table.md new file mode 100644 index 0000000..dce8e58 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/delete-table.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.deleteTable( + databaseId = "", + tableId = "" +) diff --git a/docs/examples/kotlin/tablesdb/delete.md b/docs/examples/kotlin/tablesdb/delete.md new file mode 100644 index 0000000..3e335fa --- /dev/null +++ b/docs/examples/kotlin/tablesdb/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.delete( + databaseId = "" +) diff --git a/docs/examples/kotlin/tablesdb/get-column.md b/docs/examples/kotlin/tablesdb/get-column.md new file mode 100644 index 0000000..c4cf24d --- /dev/null +++ b/docs/examples/kotlin/tablesdb/get-column.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getColumn( + databaseId = "", + tableId = "", + key = "" +) diff --git a/docs/examples/kotlin/tablesdb/get-index.md b/docs/examples/kotlin/tablesdb/get-index.md new file mode 100644 index 0000000..4db2547 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/get-index.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getIndex( + databaseId = "", + tableId = "", + key = "" +) diff --git a/docs/examples/kotlin/tablesdb/get-row.md b/docs/examples/kotlin/tablesdb/get-row.md new file mode 100644 index 0000000..ec54631 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/get-row.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.getRow( + databaseId = "", + tableId = "", + rowId = "", + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/tablesdb/get-table.md b/docs/examples/kotlin/tablesdb/get-table.md new file mode 100644 index 0000000..65afae8 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/get-table.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.getTable( + databaseId = "", + tableId = "" +) diff --git a/docs/examples/kotlin/tablesdb/get.md b/docs/examples/kotlin/tablesdb/get.md new file mode 100644 index 0000000..e58da26 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.get( + databaseId = "" +) diff --git a/docs/examples/kotlin/tablesdb/increment-row-column.md b/docs/examples/kotlin/tablesdb/increment-row-column.md new file mode 100644 index 0000000..cac151e --- /dev/null +++ b/docs/examples/kotlin/tablesdb/increment-row-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.incrementRowColumn( + databaseId = "", + tableId = "", + rowId = "", + column = "", + value = 0, // optional + max = 0 // optional +) diff --git a/docs/examples/kotlin/tablesdb/list-columns.md b/docs/examples/kotlin/tablesdb/list-columns.md new file mode 100644 index 0000000..85a9aab --- /dev/null +++ b/docs/examples/kotlin/tablesdb/list-columns.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listColumns( + databaseId = "", + tableId = "", + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/tablesdb/list-indexes.md b/docs/examples/kotlin/tablesdb/list-indexes.md new file mode 100644 index 0000000..db5aad4 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/list-indexes.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listIndexes( + databaseId = "", + tableId = "", + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/tablesdb/list-rows.md b/docs/examples/kotlin/tablesdb/list-rows.md new file mode 100644 index 0000000..b0f5df4 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/list-rows.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.listRows( + databaseId = "", + tableId = "", + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/tablesdb/list-tables.md b/docs/examples/kotlin/tablesdb/list-tables.md new file mode 100644 index 0000000..1e8eb8f --- /dev/null +++ b/docs/examples/kotlin/tablesdb/list-tables.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.listTables( + databaseId = "", + queries = listOf(), // optional + search = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/list.md b/docs/examples/kotlin/tablesdb/list.md new file mode 100644 index 0000000..58b48a0 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/list.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.list( + queries = listOf(), // optional + search = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-boolean-column.md b/docs/examples/kotlin/tablesdb/update-boolean-column.md new file mode 100644 index 0000000..43ab43b --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-boolean-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateBooleanColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = false, + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-datetime-column.md b/docs/examples/kotlin/tablesdb/update-datetime-column.md new file mode 100644 index 0000000..077cff7 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-datetime-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateDatetimeColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "", + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-email-column.md b/docs/examples/kotlin/tablesdb/update-email-column.md new file mode 100644 index 0000000..5becaa6 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-email-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateEmailColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "email@example.com", + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-enum-column.md b/docs/examples/kotlin/tablesdb/update-enum-column.md new file mode 100644 index 0000000..4351703 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-enum-column.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateEnumColumn( + databaseId = "", + tableId = "", + key = "", + elements = listOf(), + required = false, + default = "", + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-float-column.md b/docs/examples/kotlin/tablesdb/update-float-column.md new file mode 100644 index 0000000..6d40c3f --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-float-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateFloatColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = 0, + min = 0, // optional + max = 0, // optional + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-integer-column.md b/docs/examples/kotlin/tablesdb/update-integer-column.md new file mode 100644 index 0000000..9d6bfaa --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-integer-column.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateIntegerColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = 0, + min = 0, // optional + max = 0, // optional + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-ip-column.md b/docs/examples/kotlin/tablesdb/update-ip-column.md new file mode 100644 index 0000000..fd04b98 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-ip-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateIpColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "", + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-relationship-column.md b/docs/examples/kotlin/tablesdb/update-relationship-column.md new file mode 100644 index 0000000..f69defd --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-relationship-column.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRelationshipColumn( + databaseId = "", + tableId = "", + key = "", + onDelete = "cascade", // optional + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-row.md b/docs/examples/kotlin/tablesdb/update-row.md new file mode 100644 index 0000000..9c5248f --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-row.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRow( + databaseId = "", + tableId = "", + rowId = "", + data = mapOf( "a" to "b" ), // optional + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-rows.md b/docs/examples/kotlin/tablesdb/update-rows.md new file mode 100644 index 0000000..c285d5b --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-rows.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateRows( + databaseId = "", + tableId = "", + data = mapOf( "a" to "b" ), // optional + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-string-column.md b/docs/examples/kotlin/tablesdb/update-string-column.md new file mode 100644 index 0000000..acdd3ad --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-string-column.md @@ -0,0 +1,20 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateStringColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "", + size = 1, // optional + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-table.md b/docs/examples/kotlin/tablesdb/update-table.md new file mode 100644 index 0000000..5238908 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-table.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateTable( + databaseId = "", + tableId = "", + name = "", + permissions = listOf("read("any")"), // optional + rowSecurity = false, // optional + enabled = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/update-url-column.md b/docs/examples/kotlin/tablesdb/update-url-column.md new file mode 100644 index 0000000..fbe68c9 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update-url-column.md @@ -0,0 +1,19 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.updateUrlColumn( + databaseId = "", + tableId = "", + key = "", + required = false, + default = "https://example.com", + newKey = "" // optional +) diff --git a/docs/examples/kotlin/tablesdb/update.md b/docs/examples/kotlin/tablesdb/update.md new file mode 100644 index 0000000..48d1a8e --- /dev/null +++ b/docs/examples/kotlin/tablesdb/update.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.update( + databaseId = "", + name = "", + enabled = false // optional +) diff --git a/docs/examples/kotlin/tablesdb/upsert-row.md b/docs/examples/kotlin/tablesdb/upsert-row.md new file mode 100644 index 0000000..3fcbc61 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/upsert-row.md @@ -0,0 +1,18 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val tablesDB = TablesDB(client) + +val response = tablesDB.upsertRow( + databaseId = "", + tableId = "", + rowId = "", + data = mapOf( "a" to "b" ), // optional + permissions = listOf("read("any")") // optional +) diff --git a/docs/examples/kotlin/tablesdb/upsert-rows.md b/docs/examples/kotlin/tablesdb/upsert-rows.md new file mode 100644 index 0000000..7059c60 --- /dev/null +++ b/docs/examples/kotlin/tablesdb/upsert-rows.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.TablesDB + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tablesDB = TablesDB(client) + +val response = tablesDB.upsertRows( + databaseId = "", + tableId = "", + rows = listOf() +) diff --git a/docs/examples/kotlin/teams/create-membership.md b/docs/examples/kotlin/teams/create-membership.md index 250502e..33eb165 100644 --- a/docs/examples/kotlin/teams/create-membership.md +++ b/docs/examples/kotlin/teams/create-membership.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/create.md b/docs/examples/kotlin/teams/create.md index b66029f..6ec7e53 100644 --- a/docs/examples/kotlin/teams/create.md +++ b/docs/examples/kotlin/teams/create.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/delete-membership.md b/docs/examples/kotlin/teams/delete-membership.md index 0dff545..48c924f 100644 --- a/docs/examples/kotlin/teams/delete-membership.md +++ b/docs/examples/kotlin/teams/delete-membership.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/delete.md b/docs/examples/kotlin/teams/delete.md index 9a75b2a..4b70ff2 100644 --- a/docs/examples/kotlin/teams/delete.md +++ b/docs/examples/kotlin/teams/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/get-membership.md b/docs/examples/kotlin/teams/get-membership.md index 77c6ae5..a636c21 100644 --- a/docs/examples/kotlin/teams/get-membership.md +++ b/docs/examples/kotlin/teams/get-membership.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/get-prefs.md b/docs/examples/kotlin/teams/get-prefs.md index 2700c89..2b73432 100644 --- a/docs/examples/kotlin/teams/get-prefs.md +++ b/docs/examples/kotlin/teams/get-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/get.md b/docs/examples/kotlin/teams/get.md index a7be374..72b6677 100644 --- a/docs/examples/kotlin/teams/get.md +++ b/docs/examples/kotlin/teams/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/list-memberships.md b/docs/examples/kotlin/teams/list-memberships.md index 916252d..2870873 100644 --- a/docs/examples/kotlin/teams/list-memberships.md +++ b/docs/examples/kotlin/teams/list-memberships.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/list.md b/docs/examples/kotlin/teams/list.md index 5af95db..ee3e3e4 100644 --- a/docs/examples/kotlin/teams/list.md +++ b/docs/examples/kotlin/teams/list.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/update-membership-status.md b/docs/examples/kotlin/teams/update-membership-status.md index 75c4a73..b7a0d51 100644 --- a/docs/examples/kotlin/teams/update-membership-status.md +++ b/docs/examples/kotlin/teams/update-membership-status.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/update-membership.md b/docs/examples/kotlin/teams/update-membership.md index 556e0a3..7a4377f 100644 --- a/docs/examples/kotlin/teams/update-membership.md +++ b/docs/examples/kotlin/teams/update-membership.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/update-name.md b/docs/examples/kotlin/teams/update-name.md index 8e6a2a2..2f13d7c 100644 --- a/docs/examples/kotlin/teams/update-name.md +++ b/docs/examples/kotlin/teams/update-name.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/teams/update-prefs.md b/docs/examples/kotlin/teams/update-prefs.md index c9153d3..62c7f01 100644 --- a/docs/examples/kotlin/teams/update-prefs.md +++ b/docs/examples/kotlin/teams/update-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Teams val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setSession("") // The user session to authenticate with diff --git a/docs/examples/kotlin/tokens/create-file-token.md b/docs/examples/kotlin/tokens/create-file-token.md new file mode 100644 index 0000000..63d8fc3 --- /dev/null +++ b/docs/examples/kotlin/tokens/create-file-token.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.createFileToken( + bucketId = "", + fileId = "", + expire = "" // optional +) diff --git a/docs/examples/kotlin/tokens/delete.md b/docs/examples/kotlin/tokens/delete.md new file mode 100644 index 0000000..1831bc6 --- /dev/null +++ b/docs/examples/kotlin/tokens/delete.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.delete( + tokenId = "" +) diff --git a/docs/examples/kotlin/tokens/get.md b/docs/examples/kotlin/tokens/get.md new file mode 100644 index 0000000..70a47c2 --- /dev/null +++ b/docs/examples/kotlin/tokens/get.md @@ -0,0 +1,14 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.get( + tokenId = "" +) diff --git a/docs/examples/kotlin/tokens/list.md b/docs/examples/kotlin/tokens/list.md new file mode 100644 index 0000000..6975790 --- /dev/null +++ b/docs/examples/kotlin/tokens/list.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.list( + bucketId = "", + fileId = "", + queries = listOf() // optional +) diff --git a/docs/examples/kotlin/tokens/update.md b/docs/examples/kotlin/tokens/update.md new file mode 100644 index 0000000..045ddaa --- /dev/null +++ b/docs/examples/kotlin/tokens/update.md @@ -0,0 +1,15 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Tokens + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val tokens = Tokens(client) + +val response = tokens.update( + tokenId = "", + expire = "" // optional +) diff --git a/docs/examples/kotlin/users/create-argon2user.md b/docs/examples/kotlin/users/create-argon-2-user.md similarity index 84% rename from docs/examples/kotlin/users/create-argon2user.md rename to docs/examples/kotlin/users/create-argon-2-user.md index a01f6d5..27008a0 100644 --- a/docs/examples/kotlin/users/create-argon2user.md +++ b/docs/examples/kotlin/users/create-argon-2-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-bcrypt-user.md b/docs/examples/kotlin/users/create-bcrypt-user.md index b4758e4..c723130 100644 --- a/docs/examples/kotlin/users/create-bcrypt-user.md +++ b/docs/examples/kotlin/users/create-bcrypt-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-j-w-t.md b/docs/examples/kotlin/users/create-jwt.md similarity index 83% rename from docs/examples/kotlin/users/create-j-w-t.md rename to docs/examples/kotlin/users/create-jwt.md index 137847d..a556a90 100644 --- a/docs/examples/kotlin/users/create-j-w-t.md +++ b/docs/examples/kotlin/users/create-jwt.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-m-d5user.md b/docs/examples/kotlin/users/create-md-5-user.md similarity index 84% rename from docs/examples/kotlin/users/create-m-d5user.md rename to docs/examples/kotlin/users/create-md-5-user.md index f9d7cb2..27b9859 100644 --- a/docs/examples/kotlin/users/create-m-d5user.md +++ b/docs/examples/kotlin/users/create-md-5-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-mfa-recovery-codes.md b/docs/examples/kotlin/users/create-mfa-recovery-codes.md index b3a3950..7a0b1c6 100644 --- a/docs/examples/kotlin/users/create-mfa-recovery-codes.md +++ b/docs/examples/kotlin/users/create-mfa-recovery-codes.md @@ -3,12 +3,12 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val users = Users(client) -val response = users.createMfaRecoveryCodes( +val response = users.createMFARecoveryCodes( userId = "" ) diff --git a/docs/examples/kotlin/users/create-p-h-pass-user.md b/docs/examples/kotlin/users/create-ph-pass-user.md similarity index 84% rename from docs/examples/kotlin/users/create-p-h-pass-user.md rename to docs/examples/kotlin/users/create-ph-pass-user.md index 87d74aa..5441e49 100644 --- a/docs/examples/kotlin/users/create-p-h-pass-user.md +++ b/docs/examples/kotlin/users/create-ph-pass-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-scrypt-modified-user.md b/docs/examples/kotlin/users/create-scrypt-modified-user.md index f651d3f..814883c 100644 --- a/docs/examples/kotlin/users/create-scrypt-modified-user.md +++ b/docs/examples/kotlin/users/create-scrypt-modified-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-scrypt-user.md b/docs/examples/kotlin/users/create-scrypt-user.md index 2502312..619525a 100644 --- a/docs/examples/kotlin/users/create-scrypt-user.md +++ b/docs/examples/kotlin/users/create-scrypt-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-session.md b/docs/examples/kotlin/users/create-session.md index 4b0e5dc..a67e605 100644 --- a/docs/examples/kotlin/users/create-session.md +++ b/docs/examples/kotlin/users/create-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-s-h-a-user.md b/docs/examples/kotlin/users/create-sha-user.md similarity index 85% rename from docs/examples/kotlin/users/create-s-h-a-user.md rename to docs/examples/kotlin/users/create-sha-user.md index 0be03bf..17a157b 100644 --- a/docs/examples/kotlin/users/create-s-h-a-user.md +++ b/docs/examples/kotlin/users/create-sha-user.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-target.md b/docs/examples/kotlin/users/create-target.md index 4a7856b..139c6ff 100644 --- a/docs/examples/kotlin/users/create-target.md +++ b/docs/examples/kotlin/users/create-target.md @@ -4,7 +4,7 @@ import io.appwrite.services.Users import io.appwrite.enums.MessagingProviderType val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create-token.md b/docs/examples/kotlin/users/create-token.md index bd8f76d..43492f4 100644 --- a/docs/examples/kotlin/users/create-token.md +++ b/docs/examples/kotlin/users/create-token.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/create.md b/docs/examples/kotlin/users/create.md index b5bcee9..27ae85a 100644 --- a/docs/examples/kotlin/users/create.md +++ b/docs/examples/kotlin/users/create.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/delete-identity.md b/docs/examples/kotlin/users/delete-identity.md index 2c0bfae..37b4ed2 100644 --- a/docs/examples/kotlin/users/delete-identity.md +++ b/docs/examples/kotlin/users/delete-identity.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/delete-mfa-authenticator.md b/docs/examples/kotlin/users/delete-mfa-authenticator.md index 60989d4..a7c8089 100644 --- a/docs/examples/kotlin/users/delete-mfa-authenticator.md +++ b/docs/examples/kotlin/users/delete-mfa-authenticator.md @@ -4,13 +4,13 @@ import io.appwrite.services.Users import io.appwrite.enums.AuthenticatorType val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val users = Users(client) -val response = users.deleteMfaAuthenticator( +val response = users.deleteMFAAuthenticator( userId = "", type = AuthenticatorType.TOTP ) diff --git a/docs/examples/kotlin/users/delete-session.md b/docs/examples/kotlin/users/delete-session.md index 0127fa3..e9e3c7c 100644 --- a/docs/examples/kotlin/users/delete-session.md +++ b/docs/examples/kotlin/users/delete-session.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/delete-sessions.md b/docs/examples/kotlin/users/delete-sessions.md index 26d7c70..6288e1b 100644 --- a/docs/examples/kotlin/users/delete-sessions.md +++ b/docs/examples/kotlin/users/delete-sessions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/delete-target.md b/docs/examples/kotlin/users/delete-target.md index 6be6652..f93be06 100644 --- a/docs/examples/kotlin/users/delete-target.md +++ b/docs/examples/kotlin/users/delete-target.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/delete.md b/docs/examples/kotlin/users/delete.md index e250c44..b938ac7 100644 --- a/docs/examples/kotlin/users/delete.md +++ b/docs/examples/kotlin/users/delete.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/get-mfa-recovery-codes.md b/docs/examples/kotlin/users/get-mfa-recovery-codes.md index 5860b4c..1ad9197 100644 --- a/docs/examples/kotlin/users/get-mfa-recovery-codes.md +++ b/docs/examples/kotlin/users/get-mfa-recovery-codes.md @@ -3,12 +3,12 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val users = Users(client) -val response = users.getMfaRecoveryCodes( +val response = users.getMFARecoveryCodes( userId = "" ) diff --git a/docs/examples/kotlin/users/get-prefs.md b/docs/examples/kotlin/users/get-prefs.md index 7654537..927a4a4 100644 --- a/docs/examples/kotlin/users/get-prefs.md +++ b/docs/examples/kotlin/users/get-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/get-target.md b/docs/examples/kotlin/users/get-target.md index be8bbe8..556349c 100644 --- a/docs/examples/kotlin/users/get-target.md +++ b/docs/examples/kotlin/users/get-target.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/get.md b/docs/examples/kotlin/users/get.md index 8298430..70f0ee9 100644 --- a/docs/examples/kotlin/users/get.md +++ b/docs/examples/kotlin/users/get.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/list-identities.md b/docs/examples/kotlin/users/list-identities.md index 05156db..1ac0e5b 100644 --- a/docs/examples/kotlin/users/list-identities.md +++ b/docs/examples/kotlin/users/list-identities.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/list-logs.md b/docs/examples/kotlin/users/list-logs.md index 8868d0d..a263293 100644 --- a/docs/examples/kotlin/users/list-logs.md +++ b/docs/examples/kotlin/users/list-logs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/list-memberships.md b/docs/examples/kotlin/users/list-memberships.md index 5a3d2ea..7df13df 100644 --- a/docs/examples/kotlin/users/list-memberships.md +++ b/docs/examples/kotlin/users/list-memberships.md @@ -3,12 +3,14 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val users = Users(client) val response = users.listMemberships( - userId = "" + userId = "", + queries = listOf(), // optional + search = "" // optional ) diff --git a/docs/examples/kotlin/users/list-mfa-factors.md b/docs/examples/kotlin/users/list-mfa-factors.md index 25d9a4a..9d0791c 100644 --- a/docs/examples/kotlin/users/list-mfa-factors.md +++ b/docs/examples/kotlin/users/list-mfa-factors.md @@ -3,12 +3,12 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val users = Users(client) -val response = users.listMfaFactors( +val response = users.listMFAFactors( userId = "" ) diff --git a/docs/examples/kotlin/users/list-sessions.md b/docs/examples/kotlin/users/list-sessions.md index c14ebd7..4ff34dd 100644 --- a/docs/examples/kotlin/users/list-sessions.md +++ b/docs/examples/kotlin/users/list-sessions.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/list-targets.md b/docs/examples/kotlin/users/list-targets.md index d017592..0824acf 100644 --- a/docs/examples/kotlin/users/list-targets.md +++ b/docs/examples/kotlin/users/list-targets.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/list.md b/docs/examples/kotlin/users/list.md index e86ac0d..23dd217 100644 --- a/docs/examples/kotlin/users/list.md +++ b/docs/examples/kotlin/users/list.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-email-verification.md b/docs/examples/kotlin/users/update-email-verification.md index 3f5f293..ebf2232 100644 --- a/docs/examples/kotlin/users/update-email-verification.md +++ b/docs/examples/kotlin/users/update-email-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-email.md b/docs/examples/kotlin/users/update-email.md index b7a0644..a617705 100644 --- a/docs/examples/kotlin/users/update-email.md +++ b/docs/examples/kotlin/users/update-email.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-labels.md b/docs/examples/kotlin/users/update-labels.md index ecc2948..86f536f 100644 --- a/docs/examples/kotlin/users/update-labels.md +++ b/docs/examples/kotlin/users/update-labels.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-mfa-recovery-codes.md b/docs/examples/kotlin/users/update-mfa-recovery-codes.md index b8fa2c5..80b92b4 100644 --- a/docs/examples/kotlin/users/update-mfa-recovery-codes.md +++ b/docs/examples/kotlin/users/update-mfa-recovery-codes.md @@ -3,12 +3,12 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val users = Users(client) -val response = users.updateMfaRecoveryCodes( +val response = users.updateMFARecoveryCodes( userId = "" ) diff --git a/docs/examples/kotlin/users/update-mfa.md b/docs/examples/kotlin/users/update-mfa.md index a169f3d..d2f448e 100644 --- a/docs/examples/kotlin/users/update-mfa.md +++ b/docs/examples/kotlin/users/update-mfa.md @@ -3,13 +3,13 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key val users = Users(client) -val response = users.updateMfa( +val response = users.updateMFA( userId = "", mfa = false ) diff --git a/docs/examples/kotlin/users/update-name.md b/docs/examples/kotlin/users/update-name.md index 32d164d..fedfce3 100644 --- a/docs/examples/kotlin/users/update-name.md +++ b/docs/examples/kotlin/users/update-name.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-password.md b/docs/examples/kotlin/users/update-password.md index 1522267..4a0ad57 100644 --- a/docs/examples/kotlin/users/update-password.md +++ b/docs/examples/kotlin/users/update-password.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-phone-verification.md b/docs/examples/kotlin/users/update-phone-verification.md index bc8f4c6..6520ef4 100644 --- a/docs/examples/kotlin/users/update-phone-verification.md +++ b/docs/examples/kotlin/users/update-phone-verification.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-phone.md b/docs/examples/kotlin/users/update-phone.md index f00a15d..7261f95 100644 --- a/docs/examples/kotlin/users/update-phone.md +++ b/docs/examples/kotlin/users/update-phone.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-prefs.md b/docs/examples/kotlin/users/update-prefs.md index cc8dcf6..451f4ff 100644 --- a/docs/examples/kotlin/users/update-prefs.md +++ b/docs/examples/kotlin/users/update-prefs.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-status.md b/docs/examples/kotlin/users/update-status.md index e546ba5..a69ae30 100644 --- a/docs/examples/kotlin/users/update-status.md +++ b/docs/examples/kotlin/users/update-status.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/docs/examples/kotlin/users/update-target.md b/docs/examples/kotlin/users/update-target.md index 1827c6a..a18fc63 100644 --- a/docs/examples/kotlin/users/update-target.md +++ b/docs/examples/kotlin/users/update-target.md @@ -3,7 +3,7 @@ import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Users val client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint .setProject("") // Your project ID .setKey("") // Your secret API key diff --git a/scripts/publish.gradle b/scripts/publish.gradle index cee6ff0..c8c5110 100644 --- a/scripts/publish.gradle +++ b/scripts/publish.gradle @@ -10,18 +10,6 @@ java { } publishing { - repositories { - maven { - name = "sonatype" - def releaseUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('-SNAPSHOT') ? snapshotUrl : releaseUrl - credentials { - username = rootProject.ext["ossrhUsername"] - password = rootProject.ext["ossrhPassword"] - } - } - } publications { mavenJava(MavenPublication) { from components.java diff --git a/scripts/setup.gradle b/scripts/setup.gradle index 6591e1f..cd94c1d 100644 --- a/scripts/setup.gradle +++ b/scripts/setup.gradle @@ -22,15 +22,15 @@ ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') ?: ext["signing.keyId"] ext["signing.password"] = System.getenv('SIGNING_PASSWORD') ?: ext["signing.password"] ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE') ?: ext["signing.secretKeyRingFile"] -// Set up Sonatype repository +// Set up Sonatype repository using OSSRH Staging API nexusPublishing { repositories { sonatype { stagingProfileId = sonatypeStagingProfileId username = ossrhUsername password = ossrhPassword - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) } } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/Client.kt b/src/main/kotlin/io/appwrite/Client.kt index c8ff8d9..41a6878 100644 --- a/src/main/kotlin/io/appwrite/Client.kt +++ b/src/main/kotlin/io/appwrite/Client.kt @@ -21,6 +21,7 @@ import java.io.BufferedReader import java.io.File import java.io.RandomAccessFile import java.io.IOException +import java.lang.IllegalArgumentException import java.security.SecureRandom import java.security.cert.X509Certificate import javax.net.ssl.HostnameVerifier @@ -57,12 +58,12 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "user-agent" to "AppwriteKotlinSDK/6.2.0 ${System.getProperty("http.agent")}", + "user-agent" to "AppwriteKotlinSDK/10.0.0 ${System.getProperty("http.agent")}", "x-sdk-name" to "Kotlin", "x-sdk-platform" to "server", "x-sdk-language" to "kotlin", - "x-sdk-version" to "6.2.0", - "x-appwrite-response-format" to "1.6.0", + "x-sdk-version" to "10.0.0", + "x-appwrite-response-format" to "1.8.0", ) config = mutableMapOf() @@ -217,7 +218,12 @@ class Client @JvmOverloads constructor( * * @return this */ + @Throws(IllegalArgumentException::class) fun setEndpoint(endPoint: String): Client { + require(endPoint.startsWith("http://") || endPoint.startsWith("https://")) { + "Invalid endpoint URL: $endPoint" + } + this.endPoint = endPoint return this } @@ -235,9 +241,28 @@ class Client @JvmOverloads constructor( return this } + /** + * Sends a "ping" request to Appwrite to verify connectivity. + * + * @return String + */ + suspend fun ping(): String { + val apiPath = "/ping" + val apiParams = mutableMapOf() + val apiHeaders = mutableMapOf("content-type" to "application/json") + + return call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = String::class.java + ) + } + /** * Prepare the HTTP request - * + * * @param method * @param path * @param headers @@ -332,7 +357,7 @@ class Client @JvmOverloads constructor( * @param headers * @param params * - * @return [T] + * @return [T] */ @Throws(AppwriteException::class) suspend fun call( @@ -355,7 +380,7 @@ class Client @JvmOverloads constructor( * @param headers * @param params * - * @return [T] + * @return [T] */ @Throws(AppwriteException::class) suspend fun redirect( @@ -427,7 +452,7 @@ class Client @JvmOverloads constructor( var offset = 0L var result: Map<*, *>? = null - if (idParamName?.isNotEmpty() == true && params[idParamName] != "unique()") { + if (idParamName?.isNotEmpty() == true) { // Make a request to check if a file already exists val current = call( method = "GET", @@ -494,7 +519,7 @@ class Client @JvmOverloads constructor( return converter(result as Map) } - /** + /** * Await Redirect * * @param request @@ -521,18 +546,18 @@ class Client @JvmOverloads constructor( .charStream() .buffered() .use(BufferedReader::readText) - + val error = if (response.headers["content-type"]?.contains("application/json") == true) { val map = body.fromJson>() AppwriteException( - map["message"] as? String ?: "", + map["message"] as? String ?: "", (map["code"] as Number).toInt(), - map["type"] as? String ?: "", + map["type"] as? String ?: "", body ) } else { - AppwriteException(body, response.code) + AppwriteException(body, response.code, "", body) } it.cancel(error) return @@ -572,18 +597,18 @@ class Client @JvmOverloads constructor( .charStream() .buffered() .use(BufferedReader::readText) - + val error = if (response.headers["content-type"]?.contains("application/json") == true) { val map = body.fromJson>() AppwriteException( - map["message"] as? String ?: "", + map["message"] as? String ?: "", (map["code"] as Number).toInt(), - map["type"] as? String ?: "", + map["type"] as? String ?: "", body ) } else { - AppwriteException(body, response.code) + AppwriteException(body, response.code, "", body) } it.cancel(error) return @@ -601,6 +626,14 @@ class Client @JvmOverloads constructor( it.resume(true as T) return } + responseType == String::class.java -> { + val body = response.body!! + .charStream() + .buffered() + .use(BufferedReader::readText) + it.resume(body as T) + return + } responseType == ByteArray::class.java -> { it.resume(response.body!! .byteStream() @@ -629,4 +662,4 @@ class Client @JvmOverloads constructor( } }) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/io/appwrite/Query.kt b/src/main/kotlin/io/appwrite/Query.kt index 6efbb11..bb34452 100644 --- a/src/main/kotlin/io/appwrite/Query.kt +++ b/src/main/kotlin/io/appwrite/Query.kt @@ -51,6 +51,24 @@ class Query( fun contains(attribute: String, value: Any) = Query("contains", attribute, parseValue(value)).toJson() + fun notContains(attribute: String, value: Any) = Query("notContains", attribute, parseValue(value)).toJson() + + fun notSearch(attribute: String, value: String) = Query("notSearch", attribute, listOf(value)).toJson() + + fun notBetween(attribute: String, start: Any, end: Any) = Query("notBetween", attribute, listOf(start, end)).toJson() + + fun notStartsWith(attribute: String, value: String) = Query("notStartsWith", attribute, listOf(value)).toJson() + + fun notEndsWith(attribute: String, value: String) = Query("notEndsWith", attribute, listOf(value)).toJson() + + fun createdBefore(value: String) = Query("createdBefore", null, listOf(value)).toJson() + + fun createdAfter(value: String) = Query("createdAfter", null, listOf(value)).toJson() + + fun updatedBefore(value: String) = Query("updatedBefore", null, listOf(value)).toJson() + + fun updatedAfter(value: String) = Query("updatedAfter", null, listOf(value)).toJson() + fun or(queries: List) = Query("or", null, queries.map { it.fromJson() }).toJson() fun and(queries: List) = Query("and", null, queries.map { it.fromJson() }).toJson() diff --git a/src/main/kotlin/io/appwrite/enums/Adapter.kt b/src/main/kotlin/io/appwrite/enums/Adapter.kt new file mode 100644 index 0000000..3f38345 --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/Adapter.kt @@ -0,0 +1,12 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class Adapter(val value: String) { + @SerializedName("static") + STATIC("static"), + @SerializedName("ssr") + SSR("ssr"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt b/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt new file mode 100644 index 0000000..daa1589 --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/BuildRuntime.kt @@ -0,0 +1,138 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class BuildRuntime(val value: String) { + @SerializedName("node-14.5") + NODE_14_5("node-14.5"), + @SerializedName("node-16.0") + NODE_16_0("node-16.0"), + @SerializedName("node-18.0") + NODE_18_0("node-18.0"), + @SerializedName("node-19.0") + NODE_19_0("node-19.0"), + @SerializedName("node-20.0") + NODE_20_0("node-20.0"), + @SerializedName("node-21.0") + NODE_21_0("node-21.0"), + @SerializedName("node-22") + NODE_22("node-22"), + @SerializedName("php-8.0") + PHP_8_0("php-8.0"), + @SerializedName("php-8.1") + PHP_8_1("php-8.1"), + @SerializedName("php-8.2") + PHP_8_2("php-8.2"), + @SerializedName("php-8.3") + PHP_8_3("php-8.3"), + @SerializedName("ruby-3.0") + RUBY_3_0("ruby-3.0"), + @SerializedName("ruby-3.1") + RUBY_3_1("ruby-3.1"), + @SerializedName("ruby-3.2") + RUBY_3_2("ruby-3.2"), + @SerializedName("ruby-3.3") + RUBY_3_3("ruby-3.3"), + @SerializedName("python-3.8") + PYTHON_3_8("python-3.8"), + @SerializedName("python-3.9") + PYTHON_3_9("python-3.9"), + @SerializedName("python-3.10") + PYTHON_3_10("python-3.10"), + @SerializedName("python-3.11") + PYTHON_3_11("python-3.11"), + @SerializedName("python-3.12") + PYTHON_3_12("python-3.12"), + @SerializedName("python-ml-3.11") + PYTHON_ML_3_11("python-ml-3.11"), + @SerializedName("python-ml-3.12") + PYTHON_ML_3_12("python-ml-3.12"), + @SerializedName("deno-1.21") + DENO_1_21("deno-1.21"), + @SerializedName("deno-1.24") + DENO_1_24("deno-1.24"), + @SerializedName("deno-1.35") + DENO_1_35("deno-1.35"), + @SerializedName("deno-1.40") + DENO_1_40("deno-1.40"), + @SerializedName("deno-1.46") + DENO_1_46("deno-1.46"), + @SerializedName("deno-2.0") + DENO_2_0("deno-2.0"), + @SerializedName("dart-2.15") + DART_2_15("dart-2.15"), + @SerializedName("dart-2.16") + DART_2_16("dart-2.16"), + @SerializedName("dart-2.17") + DART_2_17("dart-2.17"), + @SerializedName("dart-2.18") + DART_2_18("dart-2.18"), + @SerializedName("dart-2.19") + DART_2_19("dart-2.19"), + @SerializedName("dart-3.0") + DART_3_0("dart-3.0"), + @SerializedName("dart-3.1") + DART_3_1("dart-3.1"), + @SerializedName("dart-3.3") + DART_3_3("dart-3.3"), + @SerializedName("dart-3.5") + DART_3_5("dart-3.5"), + @SerializedName("dart-3.8") + DART_3_8("dart-3.8"), + @SerializedName("dotnet-6.0") + DOTNET_6_0("dotnet-6.0"), + @SerializedName("dotnet-7.0") + DOTNET_7_0("dotnet-7.0"), + @SerializedName("dotnet-8.0") + DOTNET_8_0("dotnet-8.0"), + @SerializedName("java-8.0") + JAVA_8_0("java-8.0"), + @SerializedName("java-11.0") + JAVA_11_0("java-11.0"), + @SerializedName("java-17.0") + JAVA_17_0("java-17.0"), + @SerializedName("java-18.0") + JAVA_18_0("java-18.0"), + @SerializedName("java-21.0") + JAVA_21_0("java-21.0"), + @SerializedName("java-22") + JAVA_22("java-22"), + @SerializedName("swift-5.5") + SWIFT_5_5("swift-5.5"), + @SerializedName("swift-5.8") + SWIFT_5_8("swift-5.8"), + @SerializedName("swift-5.9") + SWIFT_5_9("swift-5.9"), + @SerializedName("swift-5.10") + SWIFT_5_10("swift-5.10"), + @SerializedName("kotlin-1.6") + KOTLIN_1_6("kotlin-1.6"), + @SerializedName("kotlin-1.8") + KOTLIN_1_8("kotlin-1.8"), + @SerializedName("kotlin-1.9") + KOTLIN_1_9("kotlin-1.9"), + @SerializedName("kotlin-2.0") + KOTLIN_2_0("kotlin-2.0"), + @SerializedName("cpp-17") + CPP_17("cpp-17"), + @SerializedName("cpp-20") + CPP_20("cpp-20"), + @SerializedName("bun-1.0") + BUN_1_0("bun-1.0"), + @SerializedName("bun-1.1") + BUN_1_1("bun-1.1"), + @SerializedName("go-1.23") + GO_1_23("go-1.23"), + @SerializedName("static-1") + STATIC_1("static-1"), + @SerializedName("flutter-3.24") + FLUTTER_3_24("flutter-3.24"), + @SerializedName("flutter-3.27") + FLUTTER_3_27("flutter-3.27"), + @SerializedName("flutter-3.29") + FLUTTER_3_29("flutter-3.29"), + @SerializedName("flutter-3.32") + FLUTTER_3_32("flutter-3.32"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/CreditCard.kt b/src/main/kotlin/io/appwrite/enums/CreditCard.kt index 063de61..1826304 100644 --- a/src/main/kotlin/io/appwrite/enums/CreditCard.kt +++ b/src/main/kotlin/io/appwrite/enums/CreditCard.kt @@ -34,7 +34,9 @@ enum class CreditCard(val value: String) { @SerializedName("mir") MIR("mir"), @SerializedName("maestro") - MAESTRO("maestro"); + MAESTRO("maestro"), + @SerializedName("rupay") + RUPAY("rupay"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/DeploymentDownloadType.kt b/src/main/kotlin/io/appwrite/enums/DeploymentDownloadType.kt new file mode 100644 index 0000000..ab75880 --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/DeploymentDownloadType.kt @@ -0,0 +1,12 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class DeploymentDownloadType(val value: String) { + @SerializedName("source") + SOURCE("source"), + @SerializedName("output") + OUTPUT("output"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Framework.kt b/src/main/kotlin/io/appwrite/enums/Framework.kt new file mode 100644 index 0000000..4087d6b --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/Framework.kt @@ -0,0 +1,36 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class Framework(val value: String) { + @SerializedName("analog") + ANALOG("analog"), + @SerializedName("angular") + ANGULAR("angular"), + @SerializedName("nextjs") + NEXTJS("nextjs"), + @SerializedName("react") + REACT("react"), + @SerializedName("nuxt") + NUXT("nuxt"), + @SerializedName("vue") + VUE("vue"), + @SerializedName("sveltekit") + SVELTEKIT("sveltekit"), + @SerializedName("astro") + ASTRO("astro"), + @SerializedName("remix") + REMIX("remix"), + @SerializedName("lynx") + LYNX("lynx"), + @SerializedName("flutter") + FLUTTER("flutter"), + @SerializedName("react-native") + REACT_NATIVE("react-native"), + @SerializedName("vite") + VITE("vite"), + @SerializedName("other") + OTHER("other"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/ImageFormat.kt b/src/main/kotlin/io/appwrite/enums/ImageFormat.kt index 25eea90..8e74806 100644 --- a/src/main/kotlin/io/appwrite/enums/ImageFormat.kt +++ b/src/main/kotlin/io/appwrite/enums/ImageFormat.kt @@ -7,14 +7,16 @@ enum class ImageFormat(val value: String) { JPG("jpg"), @SerializedName("jpeg") JPEG("jpeg"), - @SerializedName("gif") - GIF("gif"), @SerializedName("png") PNG("png"), @SerializedName("webp") WEBP("webp"), + @SerializedName("heic") + HEIC("heic"), @SerializedName("avif") - AVIF("avif"); + AVIF("avif"), + @SerializedName("gif") + GIF("gif"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Name.kt b/src/main/kotlin/io/appwrite/enums/Name.kt index 2b6f863..0ef4251 100644 --- a/src/main/kotlin/io/appwrite/enums/Name.kt +++ b/src/main/kotlin/io/appwrite/enums/Name.kt @@ -13,10 +13,10 @@ enum class Name(val value: String) { V1_MAILS("v1-mails"), @SerializedName("v1-functions") V1_FUNCTIONS("v1-functions"), - @SerializedName("v1-usage") - V1_USAGE("v1-usage"), - @SerializedName("v1-usage-dump") - V1_USAGE_DUMP("v1-usage-dump"), + @SerializedName("v1-stats-resources") + V1_STATS_RESOURCES("v1-stats-resources"), + @SerializedName("v1-stats-usage") + V1_STATS_USAGE("v1-stats-usage"), @SerializedName("v1-webhooks") V1_WEBHOOKS("v1-webhooks"), @SerializedName("v1-certificates") diff --git a/src/main/kotlin/io/appwrite/enums/OAuthProvider.kt b/src/main/kotlin/io/appwrite/enums/OAuthProvider.kt index dc1b9b3..b0cff85 100644 --- a/src/main/kotlin/io/appwrite/enums/OAuthProvider.kt +++ b/src/main/kotlin/io/appwrite/enums/OAuthProvider.kt @@ -31,6 +31,8 @@ enum class OAuthProvider(val value: String) { ETSY("etsy"), @SerializedName("facebook") FACEBOOK("facebook"), + @SerializedName("figma") + FIGMA("figma"), @SerializedName("github") GITHUB("github"), @SerializedName("gitlab") diff --git a/src/main/kotlin/io/appwrite/enums/Runtime.kt b/src/main/kotlin/io/appwrite/enums/Runtime.kt index c19f52b..084811e 100644 --- a/src/main/kotlin/io/appwrite/enums/Runtime.kt +++ b/src/main/kotlin/io/appwrite/enums/Runtime.kt @@ -45,6 +45,8 @@ enum class Runtime(val value: String) { PYTHON_3_12("python-3.12"), @SerializedName("python-ml-3.11") PYTHON_ML_3_11("python-ml-3.11"), + @SerializedName("python-ml-3.12") + PYTHON_ML_3_12("python-ml-3.12"), @SerializedName("deno-1.21") DENO_1_21("deno-1.21"), @SerializedName("deno-1.24") @@ -65,6 +67,8 @@ enum class Runtime(val value: String) { DART_2_17("dart-2.17"), @SerializedName("dart-2.18") DART_2_18("dart-2.18"), + @SerializedName("dart-2.19") + DART_2_19("dart-2.19"), @SerializedName("dart-3.0") DART_3_0("dart-3.0"), @SerializedName("dart-3.1") @@ -73,6 +77,8 @@ enum class Runtime(val value: String) { DART_3_3("dart-3.3"), @SerializedName("dart-3.5") DART_3_5("dart-3.5"), + @SerializedName("dart-3.8") + DART_3_8("dart-3.8"), @SerializedName("dotnet-6.0") DOTNET_6_0("dotnet-6.0"), @SerializedName("dotnet-7.0") @@ -120,7 +126,13 @@ enum class Runtime(val value: String) { @SerializedName("static-1") STATIC_1("static-1"), @SerializedName("flutter-3.24") - FLUTTER_3_24("flutter-3.24"); + FLUTTER_3_24("flutter-3.24"), + @SerializedName("flutter-3.27") + FLUTTER_3_27("flutter-3.27"), + @SerializedName("flutter-3.29") + FLUTTER_3_29("flutter-3.29"), + @SerializedName("flutter-3.32") + FLUTTER_3_32("flutter-3.32"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/VCSDeploymentType.kt b/src/main/kotlin/io/appwrite/enums/VCSDeploymentType.kt new file mode 100644 index 0000000..ef7147b --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/VCSDeploymentType.kt @@ -0,0 +1,14 @@ +package io.appwrite.enums + +import com.google.gson.annotations.SerializedName + +enum class VCSDeploymentType(val value: String) { + @SerializedName("branch") + BRANCH("branch"), + @SerializedName("commit") + COMMIT("commit"), + @SerializedName("tag") + TAG("tag"); + + override fun toString() = value +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/AttributeString.kt b/src/main/kotlin/io/appwrite/models/AttributeString.kt index efae2ba..161d7b8 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeString.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeString.kt @@ -67,6 +67,12 @@ data class AttributeString( @SerializedName("default") var default: String?, + /** + * Defines whether this attribute is encrypted or not. + */ + @SerializedName("encrypt") + var encrypt: Boolean?, + ) { fun toMap(): Map = mapOf( "key" to key as Any, @@ -79,6 +85,7 @@ data class AttributeString( "\$updatedAt" to updatedAt as Any, "size" to size as Any, "default" to default as Any, + "encrypt" to encrypt as Any, ) companion object { @@ -97,6 +104,7 @@ data class AttributeString( updatedAt = map["\$updatedAt"] as String, size = (map["size"] as Number).toLong(), default = map["default"] as? String?, + encrypt = map["encrypt"] as? Boolean?, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/BucketList.kt b/src/main/kotlin/io/appwrite/models/BucketList.kt index 91e331f..8c2f255 100644 --- a/src/main/kotlin/io/appwrite/models/BucketList.kt +++ b/src/main/kotlin/io/appwrite/models/BucketList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class BucketList( /** - * Total number of buckets documents that matched your query. + * Total number of buckets that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Build.kt b/src/main/kotlin/io/appwrite/models/Build.kt deleted file mode 100644 index 4f4c470..0000000 --- a/src/main/kotlin/io/appwrite/models/Build.kt +++ /dev/null @@ -1,94 +0,0 @@ -package io.appwrite.models - -import com.google.gson.annotations.SerializedName -import io.appwrite.extensions.jsonCast - -/** - * Build - */ -data class Build( - /** - * Build ID. - */ - @SerializedName("\$id") - val id: String, - - /** - * The deployment that created this build. - */ - @SerializedName("deploymentId") - val deploymentId: String, - - /** - * The build status. There are a few different types and each one means something different. \nFailed - The deployment build has failed. More details can usually be found in buildStderr\nReady - The deployment build was successful and the deployment is ready to be deployed\nProcessing - The deployment is currently waiting to have a build triggered\nBuilding - The deployment is currently being built - */ - @SerializedName("status") - val status: String, - - /** - * The stdout of the build. - */ - @SerializedName("stdout") - val stdout: String, - - /** - * The stderr of the build. - */ - @SerializedName("stderr") - val stderr: String, - - /** - * The deployment creation date in ISO 8601 format. - */ - @SerializedName("startTime") - val startTime: String, - - /** - * The time the build was finished in ISO 8601 format. - */ - @SerializedName("endTime") - val endTime: String, - - /** - * The build duration in seconds. - */ - @SerializedName("duration") - val duration: Long, - - /** - * The code size in bytes. - */ - @SerializedName("size") - val size: Long, - -) { - fun toMap(): Map = mapOf( - "\$id" to id as Any, - "deploymentId" to deploymentId as Any, - "status" to status as Any, - "stdout" to stdout as Any, - "stderr" to stderr as Any, - "startTime" to startTime as Any, - "endTime" to endTime as Any, - "duration" to duration as Any, - "size" to size as Any, - ) - - companion object { - - @Suppress("UNCHECKED_CAST") - fun from( - map: Map, - ) = Build( - id = map["\$id"] as String, - deploymentId = map["deploymentId"] as String, - status = map["status"] as String, - stdout = map["stdout"] as String, - stderr = map["stderr"] as String, - startTime = map["startTime"] as String, - endTime = map["endTime"] as String, - duration = (map["duration"] as Number).toLong(), - size = (map["size"] as Number).toLong(), - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Collection.kt b/src/main/kotlin/io/appwrite/models/Collection.kt index 56b7b41..00cfa81 100644 --- a/src/main/kotlin/io/appwrite/models/Collection.kt +++ b/src/main/kotlin/io/appwrite/models/Collection.kt @@ -44,7 +44,7 @@ data class Collection( val name: String, /** - * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. + * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. */ @SerializedName("enabled") val enabled: Boolean, diff --git a/src/main/kotlin/io/appwrite/models/CollectionList.kt b/src/main/kotlin/io/appwrite/models/CollectionList.kt index b171ae8..590efd6 100644 --- a/src/main/kotlin/io/appwrite/models/CollectionList.kt +++ b/src/main/kotlin/io/appwrite/models/CollectionList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class CollectionList( /** - * Total number of collections documents that matched your query. + * Total number of collections that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/ColumnBoolean.kt b/src/main/kotlin/io/appwrite/models/ColumnBoolean.kt new file mode 100644 index 0000000..e55bb22 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnBoolean.kt @@ -0,0 +1,94 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnBoolean + */ +data class ColumnBoolean( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + @SerializedName("default") + var default: Boolean?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "default" to default as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnBoolean( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + default = map["default"] as? Boolean?, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnDatetime.kt b/src/main/kotlin/io/appwrite/models/ColumnDatetime.kt new file mode 100644 index 0000000..fc35b86 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnDatetime.kt @@ -0,0 +1,102 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnDatetime + */ +data class ColumnDatetime( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * ISO 8601 format. + */ + @SerializedName("format") + val format: String, + + /** + * Default value for column when not provided. Only null is optional + */ + @SerializedName("default") + var default: String?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "format" to format as Any, + "default" to default as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnDatetime( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + format = map["format"] as String, + default = map["default"] as? String?, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnEmail.kt b/src/main/kotlin/io/appwrite/models/ColumnEmail.kt new file mode 100644 index 0000000..4e190f7 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnEmail.kt @@ -0,0 +1,102 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnEmail + */ +data class ColumnEmail( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * String format. + */ + @SerializedName("format") + val format: String, + + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + @SerializedName("default") + var default: String?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "format" to format as Any, + "default" to default as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnEmail( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + format = map["format"] as String, + default = map["default"] as? String?, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnEnum.kt b/src/main/kotlin/io/appwrite/models/ColumnEnum.kt new file mode 100644 index 0000000..45244b1 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnEnum.kt @@ -0,0 +1,110 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnEnum + */ +data class ColumnEnum( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Array of elements in enumerated type. + */ + @SerializedName("elements") + val elements: List, + + /** + * String format. + */ + @SerializedName("format") + val format: String, + + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + @SerializedName("default") + var default: String?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "elements" to elements as Any, + "format" to format as Any, + "default" to default as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnEnum( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + elements = map["elements"] as List, + format = map["format"] as String, + default = map["default"] as? String?, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnFloat.kt b/src/main/kotlin/io/appwrite/models/ColumnFloat.kt new file mode 100644 index 0000000..77ec024 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnFloat.kt @@ -0,0 +1,110 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnFloat + */ +data class ColumnFloat( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Minimum value to enforce for new documents. + */ + @SerializedName("min") + var min: Double?, + + /** + * Maximum value to enforce for new documents. + */ + @SerializedName("max") + var max: Double?, + + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + @SerializedName("default") + var default: Double?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "min" to min as Any, + "max" to max as Any, + "default" to default as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnFloat( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + min = (map["min"] as? Number)?.toDouble(), + max = (map["max"] as? Number)?.toDouble(), + default = (map["default"] as? Number)?.toDouble(), + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnIndex.kt b/src/main/kotlin/io/appwrite/models/ColumnIndex.kt new file mode 100644 index 0000000..617fbee --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnIndex.kt @@ -0,0 +1,102 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Index + */ +data class ColumnIndex( + /** + * Index ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Index creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Index update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Index Key. + */ + @SerializedName("key") + val key: String, + + /** + * Index type. + */ + @SerializedName("type") + val type: String, + + /** + * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an index. + */ + @SerializedName("error") + val error: String, + + /** + * Index columns. + */ + @SerializedName("columns") + val columns: List, + + /** + * Index columns length. + */ + @SerializedName("lengths") + val lengths: List, + + /** + * Index orders. + */ + @SerializedName("orders") + var orders: List?, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "columns" to columns as Any, + "lengths" to lengths as Any, + "orders" to orders as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnIndex( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + columns = map["columns"] as List, + lengths = map["lengths"] as List, + orders = map["orders"] as? List?, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnIndexList.kt b/src/main/kotlin/io/appwrite/models/ColumnIndexList.kt new file mode 100644 index 0000000..e532637 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnIndexList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Column Indexes List + */ +data class ColumnIndexList( + /** + * Total number of indexes that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of indexes. + */ + @SerializedName("indexes") + val indexes: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "indexes" to indexes.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnIndexList( + total = (map["total"] as Number).toLong(), + indexes = (map["indexes"] as List>).map { ColumnIndex.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnInteger.kt b/src/main/kotlin/io/appwrite/models/ColumnInteger.kt new file mode 100644 index 0000000..a827bd1 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnInteger.kt @@ -0,0 +1,110 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnInteger + */ +data class ColumnInteger( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Minimum value to enforce for new documents. + */ + @SerializedName("min") + var min: Long?, + + /** + * Maximum value to enforce for new documents. + */ + @SerializedName("max") + var max: Long?, + + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + @SerializedName("default") + var default: Long?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "min" to min as Any, + "max" to max as Any, + "default" to default as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnInteger( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + min = (map["min"] as? Number)?.toLong(), + max = (map["max"] as? Number)?.toLong(), + default = (map["default"] as? Number)?.toLong(), + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnIp.kt b/src/main/kotlin/io/appwrite/models/ColumnIp.kt new file mode 100644 index 0000000..b3741bb --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnIp.kt @@ -0,0 +1,102 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnIP + */ +data class ColumnIp( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * String format. + */ + @SerializedName("format") + val format: String, + + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + @SerializedName("default") + var default: String?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "format" to format as Any, + "default" to default as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnIp( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + format = map["format"] as String, + default = map["default"] as? String?, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnList.kt b/src/main/kotlin/io/appwrite/models/ColumnList.kt new file mode 100644 index 0000000..06e8bd4 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Columns List + */ +data class ColumnList( + /** + * Total number of columns in the given table. + */ + @SerializedName("total") + val total: Long, + + /** + * List of columns. + */ + @SerializedName("columns") + val columns: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "columns" to columns as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnList( + total = (map["total"] as Number).toLong(), + columns = map["columns"] as List, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnRelationship.kt b/src/main/kotlin/io/appwrite/models/ColumnRelationship.kt new file mode 100644 index 0000000..5524b42 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnRelationship.kt @@ -0,0 +1,134 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnRelationship + */ +data class ColumnRelationship( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * The ID of the related table. + */ + @SerializedName("relatedTable") + val relatedTable: String, + + /** + * The type of the relationship. + */ + @SerializedName("relationType") + val relationType: String, + + /** + * Is the relationship two-way? + */ + @SerializedName("twoWay") + val twoWay: Boolean, + + /** + * The key of the two-way relationship. + */ + @SerializedName("twoWayKey") + val twoWayKey: String, + + /** + * How deleting the parent document will propagate to child documents. + */ + @SerializedName("onDelete") + val onDelete: String, + + /** + * Whether this is the parent or child side of the relationship + */ + @SerializedName("side") + val side: String, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "relatedTable" to relatedTable as Any, + "relationType" to relationType as Any, + "twoWay" to twoWay as Any, + "twoWayKey" to twoWayKey as Any, + "onDelete" to onDelete as Any, + "side" to side as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnRelationship( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + relatedTable = map["relatedTable"] as String, + relationType = map["relationType"] as String, + twoWay = map["twoWay"] as Boolean, + twoWayKey = map["twoWayKey"] as String, + onDelete = map["onDelete"] as String, + side = map["side"] as String, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnString.kt b/src/main/kotlin/io/appwrite/models/ColumnString.kt new file mode 100644 index 0000000..773a8ce --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnString.kt @@ -0,0 +1,110 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnString + */ +data class ColumnString( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Column size. + */ + @SerializedName("size") + val size: Long, + + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + @SerializedName("default") + var default: String?, + + /** + * Defines whether this column is encrypted or not. + */ + @SerializedName("encrypt") + var encrypt: Boolean?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "size" to size as Any, + "default" to default as Any, + "encrypt" to encrypt as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnString( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + size = (map["size"] as Number).toLong(), + default = map["default"] as? String?, + encrypt = map["encrypt"] as? Boolean?, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ColumnUrl.kt b/src/main/kotlin/io/appwrite/models/ColumnUrl.kt new file mode 100644 index 0000000..10cd5d9 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ColumnUrl.kt @@ -0,0 +1,102 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ColumnURL + */ +data class ColumnUrl( + /** + * Column Key. + */ + @SerializedName("key") + val key: String, + + /** + * Column type. + */ + @SerializedName("type") + val type: String, + + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + @SerializedName("status") + val status: String, + + /** + * Error message. Displays error generated on failure of creating or deleting an column. + */ + @SerializedName("error") + val error: String, + + /** + * Is column required? + */ + @SerializedName("required") + val required: Boolean, + + /** + * Is column an array? + */ + @SerializedName("array") + var array: Boolean?, + + /** + * Column creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Column update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * String format. + */ + @SerializedName("format") + val format: String, + + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + @SerializedName("default") + var default: String?, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "type" to type as Any, + "status" to status as Any, + "error" to error as Any, + "required" to required as Any, + "array" to array as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "format" to format as Any, + "default" to default as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ColumnUrl( + key = map["key"] as String, + type = map["type"] as String, + status = map["status"] as String, + error = map["error"] as String, + required = map["required"] as Boolean, + array = map["array"] as? Boolean?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + format = map["format"] as String, + default = map["default"] as? String?, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ContinentList.kt b/src/main/kotlin/io/appwrite/models/ContinentList.kt index fdd490a..789acff 100644 --- a/src/main/kotlin/io/appwrite/models/ContinentList.kt +++ b/src/main/kotlin/io/appwrite/models/ContinentList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class ContinentList( /** - * Total number of continents documents that matched your query. + * Total number of continents that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/CountryList.kt b/src/main/kotlin/io/appwrite/models/CountryList.kt index 350a894..47c0e72 100644 --- a/src/main/kotlin/io/appwrite/models/CountryList.kt +++ b/src/main/kotlin/io/appwrite/models/CountryList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class CountryList( /** - * Total number of countries documents that matched your query. + * Total number of countries that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/CurrencyList.kt b/src/main/kotlin/io/appwrite/models/CurrencyList.kt index fe1e001..5a57a02 100644 --- a/src/main/kotlin/io/appwrite/models/CurrencyList.kt +++ b/src/main/kotlin/io/appwrite/models/CurrencyList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class CurrencyList( /** - * Total number of currencies documents that matched your query. + * Total number of currencies that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Database.kt b/src/main/kotlin/io/appwrite/models/Database.kt index 76ccdd9..f40c578 100644 --- a/src/main/kotlin/io/appwrite/models/Database.kt +++ b/src/main/kotlin/io/appwrite/models/Database.kt @@ -32,11 +32,17 @@ data class Database( val updatedAt: String, /** - * If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys. + * If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys. */ @SerializedName("enabled") val enabled: Boolean, + /** + * Database type. + */ + @SerializedName("type") + val type: String, + ) { fun toMap(): Map = mapOf( "\$id" to id as Any, @@ -44,6 +50,7 @@ data class Database( "\$createdAt" to createdAt as Any, "\$updatedAt" to updatedAt as Any, "enabled" to enabled as Any, + "type" to type as Any, ) companion object { @@ -57,6 +64,7 @@ data class Database( createdAt = map["\$createdAt"] as String, updatedAt = map["\$updatedAt"] as String, enabled = map["enabled"] as Boolean, + type = map["type"] as String, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/DatabaseList.kt b/src/main/kotlin/io/appwrite/models/DatabaseList.kt index 81c91aa..28a2b09 100644 --- a/src/main/kotlin/io/appwrite/models/DatabaseList.kt +++ b/src/main/kotlin/io/appwrite/models/DatabaseList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class DatabaseList( /** - * Total number of databases documents that matched your query. + * Total number of databases that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Deployment.kt b/src/main/kotlin/io/appwrite/models/Deployment.kt index 20db30b..9edb654 100644 --- a/src/main/kotlin/io/appwrite/models/Deployment.kt +++ b/src/main/kotlin/io/appwrite/models/Deployment.kt @@ -52,8 +52,8 @@ data class Deployment( /** * The code size in bytes. */ - @SerializedName("size") - val size: Long, + @SerializedName("sourceSize") + val sourceSize: Long, /** * The build output size in bytes. @@ -61,6 +61,12 @@ data class Deployment( @SerializedName("buildSize") val buildSize: Long, + /** + * The total size in bytes (source and build output). + */ + @SerializedName("totalSize") + val totalSize: Long, + /** * The current build ID. */ @@ -74,7 +80,19 @@ data class Deployment( val activate: Boolean, /** - * The deployment status. Possible values are "processing", "building", "waiting", "ready", and "failed". + * Screenshot with light theme preference file ID. + */ + @SerializedName("screenshotLight") + val screenshotLight: String, + + /** + * Screenshot with dark theme preference file ID. + */ + @SerializedName("screenshotDark") + val screenshotDark: String, + + /** + * The deployment status. Possible values are "waiting", "processing", "building", "ready", and "failed". */ @SerializedName("status") val status: String, @@ -88,8 +106,8 @@ data class Deployment( /** * The current build time in seconds. */ - @SerializedName("buildTime") - val buildTime: Long, + @SerializedName("buildDuration") + val buildDuration: Long, /** * The name of the vcs provider repository @@ -160,13 +178,16 @@ data class Deployment( "resourceId" to resourceId as Any, "resourceType" to resourceType as Any, "entrypoint" to entrypoint as Any, - "size" to size as Any, + "sourceSize" to sourceSize as Any, "buildSize" to buildSize as Any, + "totalSize" to totalSize as Any, "buildId" to buildId as Any, "activate" to activate as Any, + "screenshotLight" to screenshotLight as Any, + "screenshotDark" to screenshotDark as Any, "status" to status as Any, "buildLogs" to buildLogs as Any, - "buildTime" to buildTime as Any, + "buildDuration" to buildDuration as Any, "providerRepositoryName" to providerRepositoryName as Any, "providerRepositoryOwner" to providerRepositoryOwner as Any, "providerRepositoryUrl" to providerRepositoryUrl as Any, @@ -192,13 +213,16 @@ data class Deployment( resourceId = map["resourceId"] as String, resourceType = map["resourceType"] as String, entrypoint = map["entrypoint"] as String, - size = (map["size"] as Number).toLong(), + sourceSize = (map["sourceSize"] as Number).toLong(), buildSize = (map["buildSize"] as Number).toLong(), + totalSize = (map["totalSize"] as Number).toLong(), buildId = map["buildId"] as String, activate = map["activate"] as Boolean, + screenshotLight = map["screenshotLight"] as String, + screenshotDark = map["screenshotDark"] as String, status = map["status"] as String, buildLogs = map["buildLogs"] as String, - buildTime = (map["buildTime"] as Number).toLong(), + buildDuration = (map["buildDuration"] as Number).toLong(), providerRepositoryName = map["providerRepositoryName"] as String, providerRepositoryOwner = map["providerRepositoryOwner"] as String, providerRepositoryUrl = map["providerRepositoryUrl"] as String, diff --git a/src/main/kotlin/io/appwrite/models/DeploymentList.kt b/src/main/kotlin/io/appwrite/models/DeploymentList.kt index 2b7cf64..991a344 100644 --- a/src/main/kotlin/io/appwrite/models/DeploymentList.kt +++ b/src/main/kotlin/io/appwrite/models/DeploymentList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class DeploymentList( /** - * Total number of deployments documents that matched your query. + * Total number of deployments that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Document.kt b/src/main/kotlin/io/appwrite/models/Document.kt index 01204de..c0dfe61 100644 --- a/src/main/kotlin/io/appwrite/models/Document.kt +++ b/src/main/kotlin/io/appwrite/models/Document.kt @@ -13,6 +13,12 @@ data class Document( @SerializedName("\$id") val id: String, + /** + * Document automatically incrementing ID. + */ + @SerializedName("\$sequence") + val sequence: Long, + /** * Collection ID. */ @@ -51,6 +57,7 @@ data class Document( ) { fun toMap(): Map = mapOf( "\$id" to id as Any, + "\$sequence" to sequence as Any, "\$collectionId" to collectionId as Any, "\$databaseId" to databaseId as Any, "\$createdAt" to createdAt as Any, @@ -62,6 +69,7 @@ data class Document( companion object { operator fun invoke( id: String, + sequence: Long, collectionId: String, databaseId: String, createdAt: String, @@ -70,6 +78,7 @@ data class Document( data: Map ) = Document>( id, + sequence, collectionId, databaseId, createdAt, @@ -84,6 +93,7 @@ data class Document( nestedType: Class ) = Document( id = map["\$id"] as String, + sequence = (map["\$sequence"] as Number).toLong(), collectionId = map["\$collectionId"] as String, databaseId = map["\$databaseId"] as String, createdAt = map["\$createdAt"] as String, diff --git a/src/main/kotlin/io/appwrite/models/DocumentList.kt b/src/main/kotlin/io/appwrite/models/DocumentList.kt index fa3dd20..c26cd26 100644 --- a/src/main/kotlin/io/appwrite/models/DocumentList.kt +++ b/src/main/kotlin/io/appwrite/models/DocumentList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class DocumentList( /** - * Total number of documents documents that matched your query. + * Total number of documents that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Execution.kt b/src/main/kotlin/io/appwrite/models/Execution.kt index 1b6226a..8b395c6 100644 --- a/src/main/kotlin/io/appwrite/models/Execution.kt +++ b/src/main/kotlin/io/appwrite/models/Execution.kt @@ -20,7 +20,7 @@ data class Execution( val createdAt: String, /** - * Execution upate date in ISO 8601 format. + * Execution update date in ISO 8601 format. */ @SerializedName("\$updatedAt") val updatedAt: String, @@ -37,6 +37,12 @@ data class Execution( @SerializedName("functionId") val functionId: String, + /** + * Function's deployment ID used to create the execution. + */ + @SerializedName("deploymentId") + val deploymentId: String, + /** * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. */ @@ -98,7 +104,7 @@ data class Execution( val errors: String, /** - * Function execution duration in seconds. + * Resource(function/site) execution duration in seconds. */ @SerializedName("duration") val duration: Double, @@ -116,6 +122,7 @@ data class Execution( "\$updatedAt" to updatedAt as Any, "\$permissions" to permissions as Any, "functionId" to functionId as Any, + "deploymentId" to deploymentId as Any, "trigger" to trigger as Any, "status" to status as Any, "requestMethod" to requestMethod as Any, @@ -141,6 +148,7 @@ data class Execution( updatedAt = map["\$updatedAt"] as String, permissions = map["\$permissions"] as List, functionId = map["functionId"] as String, + deploymentId = map["deploymentId"] as String, trigger = map["trigger"] as String, status = map["status"] as String, requestMethod = map["requestMethod"] as String, diff --git a/src/main/kotlin/io/appwrite/models/ExecutionList.kt b/src/main/kotlin/io/appwrite/models/ExecutionList.kt index 322aeee..a976e78 100644 --- a/src/main/kotlin/io/appwrite/models/ExecutionList.kt +++ b/src/main/kotlin/io/appwrite/models/ExecutionList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class ExecutionList( /** - * Total number of executions documents that matched your query. + * Total number of executions that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/FileList.kt b/src/main/kotlin/io/appwrite/models/FileList.kt index 5af18f1..dfdd212 100644 --- a/src/main/kotlin/io/appwrite/models/FileList.kt +++ b/src/main/kotlin/io/appwrite/models/FileList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class FileList( /** - * Total number of files documents that matched your query. + * Total number of files that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Framework.kt b/src/main/kotlin/io/appwrite/models/Framework.kt new file mode 100644 index 0000000..c57b2ae --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/Framework.kt @@ -0,0 +1,62 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Framework + */ +data class Framework( + /** + * Framework key. + */ + @SerializedName("key") + val key: String, + + /** + * Framework Name. + */ + @SerializedName("name") + val name: String, + + /** + * Default runtime version. + */ + @SerializedName("buildRuntime") + val buildRuntime: String, + + /** + * List of supported runtime versions. + */ + @SerializedName("runtimes") + val runtimes: List, + + /** + * List of supported adapters. + */ + @SerializedName("adapters") + val adapters: List, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "name" to name as Any, + "buildRuntime" to buildRuntime as Any, + "runtimes" to runtimes as Any, + "adapters" to adapters.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = Framework( + key = map["key"] as String, + name = map["name"] as String, + buildRuntime = map["buildRuntime"] as String, + runtimes = map["runtimes"] as List, + adapters = (map["adapters"] as List>).map { FrameworkAdapter.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/FrameworkAdapter.kt b/src/main/kotlin/io/appwrite/models/FrameworkAdapter.kt new file mode 100644 index 0000000..5f6c688 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/FrameworkAdapter.kt @@ -0,0 +1,62 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Framework Adapter + */ +data class FrameworkAdapter( + /** + * Adapter key. + */ + @SerializedName("key") + val key: String, + + /** + * Default command to download dependencies. + */ + @SerializedName("installCommand") + val installCommand: String, + + /** + * Default command to build site into output directory. + */ + @SerializedName("buildCommand") + val buildCommand: String, + + /** + * Default output directory of build. + */ + @SerializedName("outputDirectory") + val outputDirectory: String, + + /** + * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + */ + @SerializedName("fallbackFile") + val fallbackFile: String, + +) { + fun toMap(): Map = mapOf( + "key" to key as Any, + "installCommand" to installCommand as Any, + "buildCommand" to buildCommand as Any, + "outputDirectory" to outputDirectory as Any, + "fallbackFile" to fallbackFile as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = FrameworkAdapter( + key = map["key"] as String, + installCommand = map["installCommand"] as String, + buildCommand = map["buildCommand"] as String, + outputDirectory = map["outputDirectory"] as String, + fallbackFile = map["fallbackFile"] as String, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/FrameworkList.kt b/src/main/kotlin/io/appwrite/models/FrameworkList.kt new file mode 100644 index 0000000..658bab8 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/FrameworkList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Frameworks List + */ +data class FrameworkList( + /** + * Total number of frameworks that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of frameworks. + */ + @SerializedName("frameworks") + val frameworks: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "frameworks" to frameworks.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = FrameworkList( + total = (map["total"] as Number).toLong(), + frameworks = (map["frameworks"] as List>).map { Framework.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Function.kt b/src/main/kotlin/io/appwrite/models/Function.kt index bb1b50e..6cc111f 100644 --- a/src/main/kotlin/io/appwrite/models/Function.kt +++ b/src/main/kotlin/io/appwrite/models/Function.kt @@ -44,28 +44,52 @@ data class Function( val enabled: Boolean, /** - * Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. + * Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. */ @SerializedName("live") val live: Boolean, /** - * Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + * When disabled, executions will exclude logs and errors, and will be slightly faster. */ @SerializedName("logging") val logging: Boolean, /** - * Function execution runtime. + * Function execution and build runtime. */ @SerializedName("runtime") val runtime: String, /** - * Function's active deployment ID. + * Function's active deployment ID. */ - @SerializedName("deployment") - val deployment: String, + @SerializedName("deploymentId") + val deploymentId: String, + + /** + * Active deployment creation date in ISO 8601 format. + */ + @SerializedName("deploymentCreatedAt") + val deploymentCreatedAt: String, + + /** + * Function's latest deployment ID. + */ + @SerializedName("latestDeploymentId") + val latestDeploymentId: String, + + /** + * Latest deployment creation date in ISO 8601 format. + */ + @SerializedName("latestDeploymentCreatedAt") + val latestDeploymentCreatedAt: String, + + /** + * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + */ + @SerializedName("latestDeploymentStatus") + val latestDeploymentStatus: String, /** * Allowed permission scopes. @@ -162,7 +186,11 @@ data class Function( "live" to live as Any, "logging" to logging as Any, "runtime" to runtime as Any, - "deployment" to deployment as Any, + "deploymentId" to deploymentId as Any, + "deploymentCreatedAt" to deploymentCreatedAt as Any, + "latestDeploymentId" to latestDeploymentId as Any, + "latestDeploymentCreatedAt" to latestDeploymentCreatedAt as Any, + "latestDeploymentStatus" to latestDeploymentStatus as Any, "scopes" to scopes as Any, "vars" to vars.map { it.toMap() } as Any, "events" to events as Any, @@ -194,7 +222,11 @@ data class Function( live = map["live"] as Boolean, logging = map["logging"] as Boolean, runtime = map["runtime"] as String, - deployment = map["deployment"] as String, + deploymentId = map["deploymentId"] as String, + deploymentCreatedAt = map["deploymentCreatedAt"] as String, + latestDeploymentId = map["latestDeploymentId"] as String, + latestDeploymentCreatedAt = map["latestDeploymentCreatedAt"] as String, + latestDeploymentStatus = map["latestDeploymentStatus"] as String, scopes = map["scopes"] as List, vars = (map["vars"] as List>).map { Variable.from(map = it) }, events = map["events"] as List, diff --git a/src/main/kotlin/io/appwrite/models/FunctionList.kt b/src/main/kotlin/io/appwrite/models/FunctionList.kt index 6aaa86a..ba19cec 100644 --- a/src/main/kotlin/io/appwrite/models/FunctionList.kt +++ b/src/main/kotlin/io/appwrite/models/FunctionList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class FunctionList( /** - * Total number of functions documents that matched your query. + * Total number of functions that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/IdentityList.kt b/src/main/kotlin/io/appwrite/models/IdentityList.kt index 1cbb07d..49c3346 100644 --- a/src/main/kotlin/io/appwrite/models/IdentityList.kt +++ b/src/main/kotlin/io/appwrite/models/IdentityList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class IdentityList( /** - * Total number of identities documents that matched your query. + * Total number of identities that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Index.kt b/src/main/kotlin/io/appwrite/models/Index.kt index c45e25f..93fe6df 100644 --- a/src/main/kotlin/io/appwrite/models/Index.kt +++ b/src/main/kotlin/io/appwrite/models/Index.kt @@ -8,7 +8,25 @@ import io.appwrite.extensions.jsonCast */ data class Index( /** - * Index Key. + * Index ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Index creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Index update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Index key. */ @SerializedName("key") val key: String, @@ -38,33 +56,29 @@ data class Index( val attributes: List, /** - * Index orders. - */ - @SerializedName("orders") - var orders: List?, - - /** - * Index creation date in ISO 8601 format. + * Index attributes length. */ - @SerializedName("\$createdAt") - val createdAt: String, + @SerializedName("lengths") + val lengths: List, /** - * Index update date in ISO 8601 format. + * Index orders. */ - @SerializedName("\$updatedAt") - val updatedAt: String, + @SerializedName("orders") + var orders: List?, ) { fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, "key" to key as Any, "type" to type as Any, "status" to status as Any, "error" to error as Any, "attributes" to attributes as Any, + "lengths" to lengths as Any, "orders" to orders as Any, - "\$createdAt" to createdAt as Any, - "\$updatedAt" to updatedAt as Any, ) companion object { @@ -73,14 +87,16 @@ data class Index( fun from( map: Map, ) = Index( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, key = map["key"] as String, type = map["type"] as String, status = map["status"] as String, error = map["error"] as String, attributes = map["attributes"] as List, + lengths = map["lengths"] as List, orders = map["orders"] as? List?, - createdAt = map["\$createdAt"] as String, - updatedAt = map["\$updatedAt"] as String, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/IndexList.kt b/src/main/kotlin/io/appwrite/models/IndexList.kt index a14167d..e757c05 100644 --- a/src/main/kotlin/io/appwrite/models/IndexList.kt +++ b/src/main/kotlin/io/appwrite/models/IndexList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class IndexList( /** - * Total number of indexes documents that matched your query. + * Total number of indexes that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/LanguageList.kt b/src/main/kotlin/io/appwrite/models/LanguageList.kt index 07559b9..1aac2f7 100644 --- a/src/main/kotlin/io/appwrite/models/LanguageList.kt +++ b/src/main/kotlin/io/appwrite/models/LanguageList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class LanguageList( /** - * Total number of languages documents that matched your query. + * Total number of languages that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Locale.kt b/src/main/kotlin/io/appwrite/models/Locale.kt index abe4a0e..93d28d4 100644 --- a/src/main/kotlin/io/appwrite/models/Locale.kt +++ b/src/main/kotlin/io/appwrite/models/Locale.kt @@ -26,7 +26,7 @@ data class Locale( val country: String, /** - * Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. + * Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. */ @SerializedName("continentCode") val continentCode: String, diff --git a/src/main/kotlin/io/appwrite/models/LocaleCodeList.kt b/src/main/kotlin/io/appwrite/models/LocaleCodeList.kt index 3973a03..7949b57 100644 --- a/src/main/kotlin/io/appwrite/models/LocaleCodeList.kt +++ b/src/main/kotlin/io/appwrite/models/LocaleCodeList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class LocaleCodeList( /** - * Total number of localeCodes documents that matched your query. + * Total number of localeCodes that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/LogList.kt b/src/main/kotlin/io/appwrite/models/LogList.kt index b9f381c..c88451c 100644 --- a/src/main/kotlin/io/appwrite/models/LogList.kt +++ b/src/main/kotlin/io/appwrite/models/LogList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class LogList( /** - * Total number of logs documents that matched your query. + * Total number of logs that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/MembershipList.kt b/src/main/kotlin/io/appwrite/models/MembershipList.kt index 7feaaaa..b2bea4e 100644 --- a/src/main/kotlin/io/appwrite/models/MembershipList.kt +++ b/src/main/kotlin/io/appwrite/models/MembershipList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class MembershipList( /** - * Total number of memberships documents that matched your query. + * Total number of memberships that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/MessageList.kt b/src/main/kotlin/io/appwrite/models/MessageList.kt index 85e4a1b..5f27130 100644 --- a/src/main/kotlin/io/appwrite/models/MessageList.kt +++ b/src/main/kotlin/io/appwrite/models/MessageList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class MessageList( /** - * Total number of messages documents that matched your query. + * Total number of messages that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/PhoneList.kt b/src/main/kotlin/io/appwrite/models/PhoneList.kt index b17de4f..5f7c22f 100644 --- a/src/main/kotlin/io/appwrite/models/PhoneList.kt +++ b/src/main/kotlin/io/appwrite/models/PhoneList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class PhoneList( /** - * Total number of phones documents that matched your query. + * Total number of phones that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/ProviderList.kt b/src/main/kotlin/io/appwrite/models/ProviderList.kt index 113ba67..0676663 100644 --- a/src/main/kotlin/io/appwrite/models/ProviderList.kt +++ b/src/main/kotlin/io/appwrite/models/ProviderList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class ProviderList( /** - * Total number of providers documents that matched your query. + * Total number of providers that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/ResourceToken.kt b/src/main/kotlin/io/appwrite/models/ResourceToken.kt new file mode 100644 index 0000000..06466a1 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ResourceToken.kt @@ -0,0 +1,78 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * ResourceToken + */ +data class ResourceToken( + /** + * Token ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Token creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Resource ID. + */ + @SerializedName("resourceId") + val resourceId: String, + + /** + * Resource type. + */ + @SerializedName("resourceType") + val resourceType: String, + + /** + * Token expiration date in ISO 8601 format. + */ + @SerializedName("expire") + val expire: String, + + /** + * JWT encoded string. + */ + @SerializedName("secret") + val secret: String, + + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + @SerializedName("accessedAt") + val accessedAt: String, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "resourceId" to resourceId as Any, + "resourceType" to resourceType as Any, + "expire" to expire as Any, + "secret" to secret as Any, + "accessedAt" to accessedAt as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ResourceToken( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + resourceId = map["resourceId"] as String, + resourceType = map["resourceType"] as String, + expire = map["expire"] as String, + secret = map["secret"] as String, + accessedAt = map["accessedAt"] as String, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/ResourceTokenList.kt b/src/main/kotlin/io/appwrite/models/ResourceTokenList.kt new file mode 100644 index 0000000..07b1e4c --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/ResourceTokenList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Resource Tokens List + */ +data class ResourceTokenList( + /** + * Total number of tokens that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of tokens. + */ + @SerializedName("tokens") + val tokens: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "tokens" to tokens.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = ResourceTokenList( + total = (map["total"] as Number).toLong(), + tokens = (map["tokens"] as List>).map { ResourceToken.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Row.kt b/src/main/kotlin/io/appwrite/models/Row.kt new file mode 100644 index 0000000..bb5c14f --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/Row.kt @@ -0,0 +1,105 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Row + */ +data class Row( + /** + * Row ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Row automatically incrementing ID. + */ + @SerializedName("\$sequence") + val sequence: Long, + + /** + * Table ID. + */ + @SerializedName("\$tableId") + val tableId: String, + + /** + * Database ID. + */ + @SerializedName("\$databaseId") + val databaseId: String, + + /** + * Row creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Row update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + @SerializedName("\$permissions") + val permissions: List, + + /** + * Additional properties + */ + @SerializedName("data") + val data: T +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$sequence" to sequence as Any, + "\$tableId" to tableId as Any, + "\$databaseId" to databaseId as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "\$permissions" to permissions as Any, + "data" to data!!.jsonCast(to = Map::class.java) + ) + + companion object { + operator fun invoke( + id: String, + sequence: Long, + tableId: String, + databaseId: String, + createdAt: String, + updatedAt: String, + permissions: List, + data: Map + ) = Row>( + id, + sequence, + tableId, + databaseId, + createdAt, + updatedAt, + permissions, + data + ) + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + nestedType: Class + ) = Row( + id = map["\$id"] as String, + sequence = (map["\$sequence"] as Number).toLong(), + tableId = map["\$tableId"] as String, + databaseId = map["\$databaseId"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + permissions = map["\$permissions"] as List, + data = map.jsonCast(to = nestedType) + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/RowList.kt b/src/main/kotlin/io/appwrite/models/RowList.kt new file mode 100644 index 0000000..5e99cd7 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/RowList.kt @@ -0,0 +1,46 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Rows List + */ +data class RowList( + /** + * Total number of rows that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of rows. + */ + @SerializedName("rows") + val rows: List>, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "rows" to rows.map { it.toMap() } as Any, + ) + + companion object { + operator fun invoke( + total: Long, + rows: List>>, + ) = RowList>( + total, + rows, + ) + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + nestedType: Class + ) = RowList( + total = (map["total"] as Number).toLong(), + rows = (map["rows"] as List>).map { Row.from(map = it, nestedType) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/RuntimeList.kt b/src/main/kotlin/io/appwrite/models/RuntimeList.kt index d08e9a2..8aefaaa 100644 --- a/src/main/kotlin/io/appwrite/models/RuntimeList.kt +++ b/src/main/kotlin/io/appwrite/models/RuntimeList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class RuntimeList( /** - * Total number of runtimes documents that matched your query. + * Total number of runtimes that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/SessionList.kt b/src/main/kotlin/io/appwrite/models/SessionList.kt index c7080e6..22fba69 100644 --- a/src/main/kotlin/io/appwrite/models/SessionList.kt +++ b/src/main/kotlin/io/appwrite/models/SessionList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class SessionList( /** - * Total number of sessions documents that matched your query. + * Total number of sessions that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Site.kt b/src/main/kotlin/io/appwrite/models/Site.kt new file mode 100644 index 0000000..c246ac1 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/Site.kt @@ -0,0 +1,254 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Site + */ +data class Site( + /** + * Site ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Site creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Site update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Site name. + */ + @SerializedName("name") + val name: String, + + /** + * Site enabled. + */ + @SerializedName("enabled") + val enabled: Boolean, + + /** + * Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration. + */ + @SerializedName("live") + val live: Boolean, + + /** + * When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + */ + @SerializedName("logging") + val logging: Boolean, + + /** + * Site framework. + */ + @SerializedName("framework") + val framework: String, + + /** + * Site's active deployment ID. + */ + @SerializedName("deploymentId") + val deploymentId: String, + + /** + * Active deployment creation date in ISO 8601 format. + */ + @SerializedName("deploymentCreatedAt") + val deploymentCreatedAt: String, + + /** + * Screenshot of active deployment with light theme preference file ID. + */ + @SerializedName("deploymentScreenshotLight") + val deploymentScreenshotLight: String, + + /** + * Screenshot of active deployment with dark theme preference file ID. + */ + @SerializedName("deploymentScreenshotDark") + val deploymentScreenshotDark: String, + + /** + * Site's latest deployment ID. + */ + @SerializedName("latestDeploymentId") + val latestDeploymentId: String, + + /** + * Latest deployment creation date in ISO 8601 format. + */ + @SerializedName("latestDeploymentCreatedAt") + val latestDeploymentCreatedAt: String, + + /** + * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + */ + @SerializedName("latestDeploymentStatus") + val latestDeploymentStatus: String, + + /** + * Site variables. + */ + @SerializedName("vars") + val vars: List, + + /** + * Site request timeout in seconds. + */ + @SerializedName("timeout") + val timeout: Long, + + /** + * The install command used to install the site dependencies. + */ + @SerializedName("installCommand") + val installCommand: String, + + /** + * The build command used to build the site. + */ + @SerializedName("buildCommand") + val buildCommand: String, + + /** + * The directory where the site build output is located. + */ + @SerializedName("outputDirectory") + val outputDirectory: String, + + /** + * Site VCS (Version Control System) installation id. + */ + @SerializedName("installationId") + val installationId: String, + + /** + * VCS (Version Control System) Repository ID + */ + @SerializedName("providerRepositoryId") + val providerRepositoryId: String, + + /** + * VCS (Version Control System) branch name + */ + @SerializedName("providerBranch") + val providerBranch: String, + + /** + * Path to site in VCS (Version Control System) repository + */ + @SerializedName("providerRootDirectory") + val providerRootDirectory: String, + + /** + * Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests + */ + @SerializedName("providerSilentMode") + val providerSilentMode: Boolean, + + /** + * Machine specification for builds and executions. + */ + @SerializedName("specification") + val specification: String, + + /** + * Site build runtime. + */ + @SerializedName("buildRuntime") + val buildRuntime: String, + + /** + * Site framework adapter. + */ + @SerializedName("adapter") + val adapter: String, + + /** + * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + */ + @SerializedName("fallbackFile") + val fallbackFile: String, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "name" to name as Any, + "enabled" to enabled as Any, + "live" to live as Any, + "logging" to logging as Any, + "framework" to framework as Any, + "deploymentId" to deploymentId as Any, + "deploymentCreatedAt" to deploymentCreatedAt as Any, + "deploymentScreenshotLight" to deploymentScreenshotLight as Any, + "deploymentScreenshotDark" to deploymentScreenshotDark as Any, + "latestDeploymentId" to latestDeploymentId as Any, + "latestDeploymentCreatedAt" to latestDeploymentCreatedAt as Any, + "latestDeploymentStatus" to latestDeploymentStatus as Any, + "vars" to vars.map { it.toMap() } as Any, + "timeout" to timeout as Any, + "installCommand" to installCommand as Any, + "buildCommand" to buildCommand as Any, + "outputDirectory" to outputDirectory as Any, + "installationId" to installationId as Any, + "providerRepositoryId" to providerRepositoryId as Any, + "providerBranch" to providerBranch as Any, + "providerRootDirectory" to providerRootDirectory as Any, + "providerSilentMode" to providerSilentMode as Any, + "specification" to specification as Any, + "buildRuntime" to buildRuntime as Any, + "adapter" to adapter as Any, + "fallbackFile" to fallbackFile as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = Site( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + name = map["name"] as String, + enabled = map["enabled"] as Boolean, + live = map["live"] as Boolean, + logging = map["logging"] as Boolean, + framework = map["framework"] as String, + deploymentId = map["deploymentId"] as String, + deploymentCreatedAt = map["deploymentCreatedAt"] as String, + deploymentScreenshotLight = map["deploymentScreenshotLight"] as String, + deploymentScreenshotDark = map["deploymentScreenshotDark"] as String, + latestDeploymentId = map["latestDeploymentId"] as String, + latestDeploymentCreatedAt = map["latestDeploymentCreatedAt"] as String, + latestDeploymentStatus = map["latestDeploymentStatus"] as String, + vars = (map["vars"] as List>).map { Variable.from(map = it) }, + timeout = (map["timeout"] as Number).toLong(), + installCommand = map["installCommand"] as String, + buildCommand = map["buildCommand"] as String, + outputDirectory = map["outputDirectory"] as String, + installationId = map["installationId"] as String, + providerRepositoryId = map["providerRepositoryId"] as String, + providerBranch = map["providerBranch"] as String, + providerRootDirectory = map["providerRootDirectory"] as String, + providerSilentMode = map["providerSilentMode"] as Boolean, + specification = map["specification"] as String, + buildRuntime = map["buildRuntime"] as String, + adapter = map["adapter"] as String, + fallbackFile = map["fallbackFile"] as String, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/SiteList.kt b/src/main/kotlin/io/appwrite/models/SiteList.kt new file mode 100644 index 0000000..f280b5d --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/SiteList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Sites List + */ +data class SiteList( + /** + * Total number of sites that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of sites. + */ + @SerializedName("sites") + val sites: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "sites" to sites.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = SiteList( + total = (map["total"] as Number).toLong(), + sites = (map["sites"] as List>).map { Site.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/SpecificationList.kt b/src/main/kotlin/io/appwrite/models/SpecificationList.kt index f504577..f2e6688 100644 --- a/src/main/kotlin/io/appwrite/models/SpecificationList.kt +++ b/src/main/kotlin/io/appwrite/models/SpecificationList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class SpecificationList( /** - * Total number of specifications documents that matched your query. + * Total number of specifications that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/SubscriberList.kt b/src/main/kotlin/io/appwrite/models/SubscriberList.kt index 87181a3..8cfadf0 100644 --- a/src/main/kotlin/io/appwrite/models/SubscriberList.kt +++ b/src/main/kotlin/io/appwrite/models/SubscriberList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class SubscriberList( /** - * Total number of subscribers documents that matched your query. + * Total number of subscribers that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Table.kt b/src/main/kotlin/io/appwrite/models/Table.kt new file mode 100644 index 0000000..c741b43 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/Table.kt @@ -0,0 +1,102 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Table + */ +data class Table( + /** + * Table ID. + */ + @SerializedName("\$id") + val id: String, + + /** + * Table creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Table update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, + + /** + * Table permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + @SerializedName("\$permissions") + val permissions: List, + + /** + * Database ID. + */ + @SerializedName("databaseId") + val databaseId: String, + + /** + * Table name. + */ + @SerializedName("name") + val name: String, + + /** + * Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys. + */ + @SerializedName("enabled") + val enabled: Boolean, + + /** + * Whether row-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + @SerializedName("rowSecurity") + val rowSecurity: Boolean, + + /** + * Table columns. + */ + @SerializedName("columns") + val columns: List, + + /** + * Table indexes. + */ + @SerializedName("indexes") + val indexes: List, + +) { + fun toMap(): Map = mapOf( + "\$id" to id as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, + "\$permissions" to permissions as Any, + "databaseId" to databaseId as Any, + "name" to name as Any, + "enabled" to enabled as Any, + "rowSecurity" to rowSecurity as Any, + "columns" to columns as Any, + "indexes" to indexes.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = Table( + id = map["\$id"] as String, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, + permissions = map["\$permissions"] as List, + databaseId = map["databaseId"] as String, + name = map["name"] as String, + enabled = map["enabled"] as Boolean, + rowSecurity = map["rowSecurity"] as Boolean, + columns = map["columns"] as List, + indexes = (map["indexes"] as List>).map { ColumnIndex.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/TableList.kt b/src/main/kotlin/io/appwrite/models/TableList.kt new file mode 100644 index 0000000..0cd5cc9 --- /dev/null +++ b/src/main/kotlin/io/appwrite/models/TableList.kt @@ -0,0 +1,38 @@ +package io.appwrite.models + +import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast + +/** + * Tables List + */ +data class TableList( + /** + * Total number of tables that matched your query. + */ + @SerializedName("total") + val total: Long, + + /** + * List of tables. + */ + @SerializedName("tables") + val tables: List, + +) { + fun toMap(): Map = mapOf( + "total" to total as Any, + "tables" to tables.map { it.toMap() } as Any, + ) + + companion object { + + @Suppress("UNCHECKED_CAST") + fun from( + map: Map, + ) = TableList( + total = (map["total"] as Number).toLong(), + tables = (map["tables"] as List>).map { Table.from(map = it) }, + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/TargetList.kt b/src/main/kotlin/io/appwrite/models/TargetList.kt index 01470c8..6307609 100644 --- a/src/main/kotlin/io/appwrite/models/TargetList.kt +++ b/src/main/kotlin/io/appwrite/models/TargetList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class TargetList( /** - * Total number of targets documents that matched your query. + * Total number of targets that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/TeamList.kt b/src/main/kotlin/io/appwrite/models/TeamList.kt index 17ccd6b..c95cc56 100644 --- a/src/main/kotlin/io/appwrite/models/TeamList.kt +++ b/src/main/kotlin/io/appwrite/models/TeamList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class TeamList( /** - * Total number of teams documents that matched your query. + * Total number of teams that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/TopicList.kt b/src/main/kotlin/io/appwrite/models/TopicList.kt index 7173fec..68be717 100644 --- a/src/main/kotlin/io/appwrite/models/TopicList.kt +++ b/src/main/kotlin/io/appwrite/models/TopicList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class TopicList( /** - * Total number of topics documents that matched your query. + * Total number of topics that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/UserList.kt b/src/main/kotlin/io/appwrite/models/UserList.kt index efe164f..b89e46e 100644 --- a/src/main/kotlin/io/appwrite/models/UserList.kt +++ b/src/main/kotlin/io/appwrite/models/UserList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class UserList( /** - * Total number of users documents that matched your query. + * Total number of users that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/models/Variable.kt b/src/main/kotlin/io/appwrite/models/Variable.kt index 99a7696..992fcdf 100644 --- a/src/main/kotlin/io/appwrite/models/Variable.kt +++ b/src/main/kotlin/io/appwrite/models/Variable.kt @@ -38,13 +38,19 @@ data class Variable( val value: String, /** - * Service to which the variable belongs. Possible values are "project", "function" + * Variable secret flag. Secret variables can only be updated or deleted, but never read. + */ + @SerializedName("secret") + val secret: Boolean, + + /** + * Service to which the variable belongs. Possible values are "project", "function" */ @SerializedName("resourceType") val resourceType: String, /** - * ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function. + * ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function. */ @SerializedName("resourceId") val resourceId: String, @@ -56,6 +62,7 @@ data class Variable( "\$updatedAt" to updatedAt as Any, "key" to key as Any, "value" to value as Any, + "secret" to secret as Any, "resourceType" to resourceType as Any, "resourceId" to resourceId as Any, ) @@ -71,6 +78,7 @@ data class Variable( updatedAt = map["\$updatedAt"] as String, key = map["key"] as String, value = map["value"] as String, + secret = map["secret"] as Boolean, resourceType = map["resourceType"] as String, resourceId = map["resourceId"] as String, ) diff --git a/src/main/kotlin/io/appwrite/models/VariableList.kt b/src/main/kotlin/io/appwrite/models/VariableList.kt index 06004c6..492b67e 100644 --- a/src/main/kotlin/io/appwrite/models/VariableList.kt +++ b/src/main/kotlin/io/appwrite/models/VariableList.kt @@ -8,7 +8,7 @@ import io.appwrite.extensions.jsonCast */ data class VariableList( /** - * Total number of variables documents that matched your query. + * Total number of variables that matched your query. */ @SerializedName("total") val total: Long, diff --git a/src/main/kotlin/io/appwrite/services/Account.kt b/src/main/kotlin/io/appwrite/services/Account.kt index aaa851c..46b5cf3 100644 --- a/src/main/kotlin/io/appwrite/services/Account.kt +++ b/src/main/kotlin/io/appwrite/services/Account.kt @@ -14,8 +14,6 @@ import java.io.File class Account(client: Client) : Service(client) { /** - * Get account - * * Get the currently logged in user. * * @return [io.appwrite.models.User] @@ -28,8 +26,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.User = { io.appwrite.models.User.from(map = it as Map, nestedType) @@ -45,8 +42,6 @@ class Account(client: Client) : Service(client) { } /** - * Get account - * * Get the currently logged in user. * * @return [io.appwrite.models.User] @@ -58,8 +53,6 @@ class Account(client: Client) : Service(client) { ) /** - * Create account - * * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -85,7 +78,7 @@ class Account(client: Client) : Service(client) { "password" to password, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -102,8 +95,6 @@ class Account(client: Client) : Service(client) { } /** - * Create account - * * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -128,9 +119,9 @@ class Account(client: Client) : Service(client) { ) /** - * Update email - * - * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. + * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + * * * @param email User email. * @param password User password. Must be at least 8 chars. @@ -148,7 +139,7 @@ class Account(client: Client) : Service(client) { "email" to email, "password" to password, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -165,9 +156,9 @@ class Account(client: Client) : Service(client) { } /** - * Update email - * - * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. + * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + * * * @param email User email. * @param password User password. Must be at least 8 chars. @@ -184,8 +175,6 @@ class Account(client: Client) : Service(client) { ) /** - * List identities - * * Get the list of identities for the currently logged in user. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry @@ -201,8 +190,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.IdentityList = { io.appwrite.models.IdentityList.from(map = it as Map) @@ -218,8 +206,6 @@ class Account(client: Client) : Service(client) { } /** - * Delete identity - * * Delete an identity by its unique ID. * * @param identityId Identity ID. @@ -234,7 +220,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -247,8 +233,6 @@ class Account(client: Client) : Service(client) { } /** - * Create JWT - * * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. * * @return [io.appwrite.models.Jwt] @@ -260,7 +244,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Jwt = { @@ -277,8 +261,6 @@ class Account(client: Client) : Service(client) { } /** - * List logs - * * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset @@ -294,8 +276,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.LogList = { io.appwrite.models.LogList.from(map = it as Map) @@ -311,8 +292,6 @@ class Account(client: Client) : Service(client) { } /** - * Update MFA - * * Enable or disable MFA on an account. * * @param mfa Enable or disable MFA. @@ -328,7 +307,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( "mfa" to mfa, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -345,8 +324,6 @@ class Account(client: Client) : Service(client) { } /** - * Update MFA - * * Enable or disable MFA on an account. * * @param mfa Enable or disable MFA. @@ -361,13 +338,15 @@ class Account(client: Client) : Service(client) { ) /** - * Create authenticator - * * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. * * @param type Type of authenticator. Must be `totp` * @return [io.appwrite.models.MfaType] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.createMFAAuthenticator` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.createMFAAuthenticator") + ) @Throws(AppwriteException::class) suspend fun createMfaAuthenticator( type: io.appwrite.enums.AuthenticatorType, @@ -377,7 +356,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaType = { @@ -394,14 +373,47 @@ class Account(client: Client) : Service(client) { } /** - * Verify authenticator + * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. * + * @param type Type of authenticator. Must be `totp` + * @return [io.appwrite.models.MfaType] + */ + @Throws(AppwriteException::class) + suspend fun createMFAAuthenticator( + type: io.appwrite.enums.AuthenticatorType, + ): io.appwrite.models.MfaType { + val apiPath = "/account/mfa/authenticators/{type}" + .replace("{type}", type.value) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.MfaType = { + io.appwrite.models.MfaType.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaType::class.java, + converter, + ) + } + + /** * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * * @param type Type of authenticator. * @param otp Valid verification token. * @return [io.appwrite.models.User] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.updateMFAAuthenticator` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.updateMFAAuthenticator") + ) @Throws(AppwriteException::class) suspend fun updateMfaAuthenticator( type: io.appwrite.enums.AuthenticatorType, @@ -414,7 +426,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( "otp" to otp, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -431,14 +443,16 @@ class Account(client: Client) : Service(client) { } /** - * Verify authenticator - * * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * * @param type Type of authenticator. * @param otp Valid verification token. * @return [io.appwrite.models.User] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.updateMFAAuthenticator` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.updateMFAAuthenticator") + ) @Throws(AppwriteException::class) suspend fun updateMfaAuthenticator( type: io.appwrite.enums.AuthenticatorType, @@ -450,13 +464,67 @@ class Account(client: Client) : Service(client) { ) /** - * Delete authenticator + * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * + * @param type Type of authenticator. + * @param otp Valid verification token. + * @return [io.appwrite.models.User] + */ + @Throws(AppwriteException::class) + suspend fun updateMFAAuthenticator( + type: io.appwrite.enums.AuthenticatorType, + otp: String, + nestedType: Class, + ): io.appwrite.models.User { + val apiPath = "/account/mfa/authenticators/{type}" + .replace("{type}", type.value) + + val apiParams = mutableMapOf( + "otp" to otp, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.User = { + io.appwrite.models.User.from(map = it as Map, nestedType) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. + * + * @param type Type of authenticator. + * @param otp Valid verification token. + * @return [io.appwrite.models.User] + */ + @Throws(AppwriteException::class) + suspend fun updateMFAAuthenticator( + type: io.appwrite.enums.AuthenticatorType, + otp: String, + ): io.appwrite.models.User> = updateMFAAuthenticator( + type, + otp, + nestedType = classOf(), + ) + + /** * Delete an authenticator for a user by ID. * * @param type Type of authenticator. * @return [Any] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.deleteMFAAuthenticator` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.deleteMFAAuthenticator") + ) @Throws(AppwriteException::class) suspend fun deleteMfaAuthenticator( type: io.appwrite.enums.AuthenticatorType, @@ -466,7 +534,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -479,13 +547,42 @@ class Account(client: Client) : Service(client) { } /** - * Create MFA challenge + * Delete an authenticator for a user by ID. * + * @param type Type of authenticator. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteMFAAuthenticator( + type: io.appwrite.enums.AuthenticatorType, + ): Any { + val apiPath = "/account/mfa/authenticators/{type}" + .replace("{type}", type.value) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * * @param factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. * @return [io.appwrite.models.MfaChallenge] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.createMFAChallenge") + ) @Throws(AppwriteException::class) suspend fun createMfaChallenge( factor: io.appwrite.enums.AuthenticationFactor, @@ -495,7 +592,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( "factor" to factor, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaChallenge = { @@ -512,44 +609,117 @@ class Account(client: Client) : Service(client) { } /** - * Create MFA challenge (confirmation) + * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * + * @param factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @return [io.appwrite.models.MfaChallenge] + */ + @Throws(AppwriteException::class) + suspend fun createMFAChallenge( + factor: io.appwrite.enums.AuthenticationFactor, + ): io.appwrite.models.MfaChallenge { + val apiPath = "/account/mfa/challenge" + + val apiParams = mutableMapOf( + "factor" to factor, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.MfaChallenge = { + io.appwrite.models.MfaChallenge.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaChallenge::class.java, + converter, + ) + } + + /** * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * * @param challengeId ID of the challenge. * @param otp Valid verification token. - * @return [Any] + * @return [io.appwrite.models.Session] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.updateMFAChallenge` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.updateMFAChallenge") + ) @Throws(AppwriteException::class) suspend fun updateMfaChallenge( challengeId: String, otp: String, - ): Any { + ): io.appwrite.models.Session { val apiPath = "/account/mfa/challenge" val apiParams = mutableMapOf( "challengeId" to challengeId, "otp" to otp, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) + val converter: (Any) -> io.appwrite.models.Session = { + io.appwrite.models.Session.from(map = it as Map) + } return client.call( "PUT", apiPath, apiHeaders, apiParams, - responseType = Any::class.java, + responseType = io.appwrite.models.Session::class.java, + converter, ) } /** - * List factors + * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * + * @param challengeId ID of the challenge. + * @param otp Valid verification token. + * @return [io.appwrite.models.Session] + */ + @Throws(AppwriteException::class) + suspend fun updateMFAChallenge( + challengeId: String, + otp: String, + ): io.appwrite.models.Session { + val apiPath = "/account/mfa/challenge" + + val apiParams = mutableMapOf( + "challengeId" to challengeId, + "otp" to otp, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Session = { + io.appwrite.models.Session.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Session::class.java, + converter, + ) + } + + /** * List the factors available on the account to be used as a MFA challange. * * @return [io.appwrite.models.MfaFactors] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.listMFAFactors` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.listMFAFactors") + ) @Throws(AppwriteException::class) suspend fun listMfaFactors( ): io.appwrite.models.MfaFactors { @@ -557,8 +727,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.MfaFactors = { io.appwrite.models.MfaFactors.from(map = it as Map) @@ -574,12 +743,41 @@ class Account(client: Client) : Service(client) { } /** - * Get MFA recovery codes + * List the factors available on the account to be used as a MFA challange. * + * @return [io.appwrite.models.MfaFactors] + */ + @Throws(AppwriteException::class) + suspend fun listMFAFactors( + ): io.appwrite.models.MfaFactors { + val apiPath = "/account/mfa/factors" + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.MfaFactors = { + io.appwrite.models.MfaFactors.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaFactors::class.java, + converter, + ) + } + + /** * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. * * @return [io.appwrite.models.MfaRecoveryCodes] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.getMFARecoveryCodes` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.getMFARecoveryCodes") + ) @Throws(AppwriteException::class) suspend fun getMfaRecoveryCodes( ): io.appwrite.models.MfaRecoveryCodes { @@ -587,8 +785,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { io.appwrite.models.MfaRecoveryCodes.from(map = it as Map) @@ -604,12 +801,41 @@ class Account(client: Client) : Service(client) { } /** - * Create MFA recovery codes + * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. * - * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. + * @return [io.appwrite.models.MfaRecoveryCodes] + */ + @Throws(AppwriteException::class) + suspend fun getMFARecoveryCodes( + ): io.appwrite.models.MfaRecoveryCodes { + val apiPath = "/account/mfa/recovery-codes" + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { + io.appwrite.models.MfaRecoveryCodes.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaRecoveryCodes::class.java, + converter, + ) + } + + /** + * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * * @return [io.appwrite.models.MfaRecoveryCodes] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.createMFARecoveryCodes` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.createMFARecoveryCodes") + ) @Throws(AppwriteException::class) suspend fun createMfaRecoveryCodes( ): io.appwrite.models.MfaRecoveryCodes { @@ -617,7 +843,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @@ -634,12 +860,42 @@ class Account(client: Client) : Service(client) { } /** - * Regenerate MFA recovery codes + * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * + * @return [io.appwrite.models.MfaRecoveryCodes] + */ + @Throws(AppwriteException::class) + suspend fun createMFARecoveryCodes( + ): io.appwrite.models.MfaRecoveryCodes { + val apiPath = "/account/mfa/recovery-codes" + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { + io.appwrite.models.MfaRecoveryCodes.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaRecoveryCodes::class.java, + converter, + ) + } + + /** * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. * * @return [io.appwrite.models.MfaRecoveryCodes] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Account.updateMFARecoveryCodes` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Account.updateMFARecoveryCodes") + ) @Throws(AppwriteException::class) suspend fun updateMfaRecoveryCodes( ): io.appwrite.models.MfaRecoveryCodes { @@ -647,7 +903,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @@ -664,8 +920,34 @@ class Account(client: Client) : Service(client) { } /** - * Update name + * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. * + * @return [io.appwrite.models.MfaRecoveryCodes] + */ + @Throws(AppwriteException::class) + suspend fun updateMFARecoveryCodes( + ): io.appwrite.models.MfaRecoveryCodes { + val apiPath = "/account/mfa/recovery-codes" + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { + io.appwrite.models.MfaRecoveryCodes.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaRecoveryCodes::class.java, + converter, + ) + } + + /** * Update currently logged in user account name. * * @param name User name. Max length: 128 chars. @@ -681,7 +963,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -698,8 +980,6 @@ class Account(client: Client) : Service(client) { } /** - * Update name - * * Update currently logged in user account name. * * @param name User name. Max length: 128 chars. @@ -714,8 +994,6 @@ class Account(client: Client) : Service(client) { ) /** - * Update password - * * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. * * @param password New user password. Must be at least 8 chars. @@ -735,7 +1013,7 @@ class Account(client: Client) : Service(client) { "password" to password, "oldPassword" to oldPassword, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -752,8 +1030,6 @@ class Account(client: Client) : Service(client) { } /** - * Update password - * * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. * * @param password New user password. Must be at least 8 chars. @@ -772,9 +1048,7 @@ class Account(client: Client) : Service(client) { ) /** - * Update phone - * - * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. + * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. * * @param phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param password User password. Must be at least 8 chars. @@ -792,7 +1066,7 @@ class Account(client: Client) : Service(client) { "phone" to phone, "password" to password, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -809,9 +1083,7 @@ class Account(client: Client) : Service(client) { } /** - * Update phone - * - * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. + * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. * * @param phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param password User password. Must be at least 8 chars. @@ -828,8 +1100,6 @@ class Account(client: Client) : Service(client) { ) /** - * Get account preferences - * * Get the preferences as a key-value object for the currently logged in user. * * @return [io.appwrite.models.Preferences] @@ -842,8 +1112,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Preferences = { io.appwrite.models.Preferences.from(map = it as Map, nestedType) @@ -859,8 +1128,6 @@ class Account(client: Client) : Service(client) { } /** - * Get account preferences - * * Get the preferences as a key-value object for the currently logged in user. * * @return [io.appwrite.models.Preferences] @@ -872,8 +1139,6 @@ class Account(client: Client) : Service(client) { ) /** - * Update preferences - * * Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. * * @param prefs Prefs key-value JSON object. @@ -889,7 +1154,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( "prefs" to prefs, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -906,8 +1171,6 @@ class Account(client: Client) : Service(client) { } /** - * Update preferences - * * Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. * * @param prefs Prefs key-value JSON object. @@ -922,9 +1185,7 @@ class Account(client: Client) : Service(client) { ) /** - * Create password recovery - * - * Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. + * Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. * * @param email User email. * @param url URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. @@ -941,7 +1202,7 @@ class Account(client: Client) : Service(client) { "email" to email, "url" to url, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -958,9 +1219,9 @@ class Account(client: Client) : Service(client) { } /** - * Create password recovery (confirmation) - * - * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint.Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint. + * + * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. * * @param userId User ID. * @param secret Valid reset token. @@ -980,7 +1241,7 @@ class Account(client: Client) : Service(client) { "secret" to secret, "password" to password, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -997,8 +1258,6 @@ class Account(client: Client) : Service(client) { } /** - * List sessions - * * Get the list of active sessions across different devices for the currently logged in user. * * @return [io.appwrite.models.SessionList] @@ -1010,8 +1269,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.SessionList = { io.appwrite.models.SessionList.from(map = it as Map) @@ -1027,8 +1285,6 @@ class Account(client: Client) : Service(client) { } /** - * Delete sessions - * * Delete all sessions from the user account and remove any sessions cookies from the end client. * * @return [Any] @@ -1040,7 +1296,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -1053,8 +1309,6 @@ class Account(client: Client) : Service(client) { } /** - * Create anonymous session - * * Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session). * * @return [io.appwrite.models.Session] @@ -1066,7 +1320,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @@ -1083,9 +1337,9 @@ class Account(client: Client) : Service(client) { } /** - * Create email password session - * - * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. + * + * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * * @param email User email. * @param password User password. Must be at least 8 chars. @@ -1102,7 +1356,7 @@ class Account(client: Client) : Service(client) { "email" to email, "password" to password, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @@ -1119,14 +1373,15 @@ class Account(client: Client) : Service(client) { } /** - * Update magic URL session - * * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param secret Valid verification token. * @return [io.appwrite.models.Session] */ + @Deprecated( + message = "This API has been deprecated." + ) @Throws(AppwriteException::class) suspend fun updateMagicURLSession( userId: String, @@ -1138,7 +1393,7 @@ class Account(client: Client) : Service(client) { "userId" to userId, "secret" to secret, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @@ -1155,14 +1410,15 @@ class Account(client: Client) : Service(client) { } /** - * Update phone session - * * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param secret Valid verification token. * @return [io.appwrite.models.Session] */ + @Deprecated( + message = "This API has been deprecated." + ) @Throws(AppwriteException::class) suspend fun updatePhoneSession( userId: String, @@ -1174,7 +1430,7 @@ class Account(client: Client) : Service(client) { "userId" to userId, "secret" to secret, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @@ -1191,8 +1447,6 @@ class Account(client: Client) : Service(client) { } /** - * Create session - * * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1210,7 +1464,7 @@ class Account(client: Client) : Service(client) { "userId" to userId, "secret" to secret, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @@ -1227,9 +1481,7 @@ class Account(client: Client) : Service(client) { } /** - * Get session - * - * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. + * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. * * @param sessionId Session ID. Use the string 'current' to get the current device session. * @return [io.appwrite.models.Session] @@ -1243,8 +1495,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Session = { io.appwrite.models.Session.from(map = it as Map) @@ -1260,9 +1511,7 @@ class Account(client: Client) : Service(client) { } /** - * Update session - * - * Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. + * Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. * * @param sessionId Session ID. Use the string 'current' to update the current device session. * @return [io.appwrite.models.Session] @@ -1276,7 +1525,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @@ -1293,9 +1542,7 @@ class Account(client: Client) : Service(client) { } /** - * Delete session - * - * Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. + * Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. * * @param sessionId Session ID. Use the string 'current' to delete the current device session. * @return [Any] @@ -1309,7 +1556,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -1322,8 +1569,6 @@ class Account(client: Client) : Service(client) { } /** - * Update status - * * Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead. * * @return [io.appwrite.models.User] @@ -1336,7 +1581,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -1353,8 +1598,6 @@ class Account(client: Client) : Service(client) { } /** - * Update status - * * Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead. * * @return [io.appwrite.models.User] @@ -1366,11 +1609,12 @@ class Account(client: Client) : Service(client) { ) /** - * Create email token (OTP) + * Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. + * + * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * * - * Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). - * - * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. * @param email User email. * @param phrase Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. * @return [io.appwrite.models.Token] @@ -1389,7 +1633,7 @@ class Account(client: Client) : Service(client) { "email" to email, "phrase" to phrase, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -1406,11 +1650,12 @@ class Account(client: Client) : Service(client) { } /** - * Create magic URL token - * - * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. + * + * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * * - * @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. * @param email User email. * @param url URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param phrase Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. @@ -1432,7 +1677,7 @@ class Account(client: Client) : Service(client) { "url" to url, "phrase" to phrase, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -1449,11 +1694,13 @@ class Account(client: Client) : Service(client) { } /** - * Create OAuth2 token + * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. + * + * If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. + * + * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). - * - * @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. * @param success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -1475,8 +1722,7 @@ class Account(client: Client) : Service(client) { "failure" to failure, "scopes" to scopes, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.redirect( "GET", @@ -1487,11 +1733,11 @@ class Account(client: Client) : Service(client) { } /** - * Create phone token + * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. + * + * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). - * - * @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored. * @param phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @return [io.appwrite.models.Token] */ @@ -1506,7 +1752,7 @@ class Account(client: Client) : Service(client) { "userId" to userId, "phone" to phone, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -1523,9 +1769,10 @@ class Account(client: Client) : Service(client) { } /** - * Create email verification - * - * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. + * + * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + * * * @param url URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @return [io.appwrite.models.Token] @@ -1539,7 +1786,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( "url" to url, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -1556,8 +1803,6 @@ class Account(client: Client) : Service(client) { } /** - * Create email verification (confirmation) - * * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. * * @param userId User ID. @@ -1575,7 +1820,7 @@ class Account(client: Client) : Service(client) { "userId" to userId, "secret" to secret, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -1592,9 +1837,7 @@ class Account(client: Client) : Service(client) { } /** - * Create phone verification - * - * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. + * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. * * @return [io.appwrite.models.Token] */ @@ -1605,7 +1848,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -1622,9 +1865,7 @@ class Account(client: Client) : Service(client) { } /** - * Update phone verification (confirmation) - * - * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. + * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. * * @param userId User ID. * @param secret Valid verification token. @@ -1641,7 +1882,7 @@ class Account(client: Client) : Service(client) { "userId" to userId, "secret" to secret, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { diff --git a/src/main/kotlin/io/appwrite/services/Avatars.kt b/src/main/kotlin/io/appwrite/services/Avatars.kt index 46c9d8e..ee1ead3 100644 --- a/src/main/kotlin/io/appwrite/services/Avatars.kt +++ b/src/main/kotlin/io/appwrite/services/Avatars.kt @@ -16,14 +16,14 @@ import java.io.File class Avatars(client: Client) : Service(client) { /** - * Get browser icon - * - * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. + * + * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. * * @param code Browser Code. * @param width Image width. Pass an integer between 0 to 2000. Defaults to 100. * @param height Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param quality Image quality. Pass an integer between 0 to 100. Defaults to 100. + * @param quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @return [ByteArray] */ @JvmOverloads @@ -42,8 +42,7 @@ class Avatars(client: Client) : Service(client) { "height" to height, "quality" to quality, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -54,14 +53,15 @@ class Avatars(client: Client) : Service(client) { } /** - * Get credit card icon - * - * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. + * + * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * * - * @param code Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro. + * @param code Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay. * @param width Image width. Pass an integer between 0 to 2000. Defaults to 100. * @param height Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param quality Image quality. Pass an integer between 0 to 100. Defaults to 100. + * @param quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @return [ByteArray] */ @JvmOverloads @@ -80,8 +80,7 @@ class Avatars(client: Client) : Service(client) { "height" to height, "quality" to quality, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -92,9 +91,9 @@ class Avatars(client: Client) : Service(client) { } /** - * Get favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.This endpoint does not follow HTTP redirects. + * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. + * + * This endpoint does not follow HTTP redirects. * * @param url Website URL which you want to fetch the favicon from. * @return [ByteArray] @@ -108,8 +107,7 @@ class Avatars(client: Client) : Service(client) { val apiParams = mutableMapOf( "url" to url, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -120,14 +118,15 @@ class Avatars(client: Client) : Service(client) { } /** - * Get country flag - * - * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. + * + * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * * * @param code Country Code. ISO Alpha-2 country code format. * @param width Image width. Pass an integer between 0 to 2000. Defaults to 100. * @param height Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param quality Image quality. Pass an integer between 0 to 100. Defaults to 100. + * @param quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @return [ByteArray] */ @JvmOverloads @@ -146,8 +145,7 @@ class Avatars(client: Client) : Service(client) { "height" to height, "quality" to quality, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -158,9 +156,11 @@ class Avatars(client: Client) : Service(client) { } /** - * Get image from URL - * - * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.This endpoint does not follow HTTP redirects. + * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. + * + * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. + * + * This endpoint does not follow HTTP redirects. * * @param url Image URL which you want to crop. * @param width Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. @@ -181,8 +181,7 @@ class Avatars(client: Client) : Service(client) { "width" to width, "height" to height, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -193,9 +192,12 @@ class Avatars(client: Client) : Service(client) { } /** - * Get user initials - * - * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. + * + * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. + * + * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * * * @param name Full Name. When empty, current user name or email will be used. Max length: 128 chars. * @param width Image width. Pass an integer between 0 to 2000. Defaults to 100. @@ -219,8 +221,7 @@ class Avatars(client: Client) : Service(client) { "height" to height, "background" to background, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -231,9 +232,8 @@ class Avatars(client: Client) : Service(client) { } /** - * Get QR code - * * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. + * * * @param text Plain text to be converted to QR code image. * @param size QR code size. Pass an integer between 1 to 1000. Defaults to 400. @@ -257,8 +257,7 @@ class Avatars(client: Client) : Service(client) { "margin" to margin, "download" to download, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", diff --git a/src/main/kotlin/io/appwrite/services/Databases.kt b/src/main/kotlin/io/appwrite/services/Databases.kt index 770412a..b9c75a1 100644 --- a/src/main/kotlin/io/appwrite/services/Databases.kt +++ b/src/main/kotlin/io/appwrite/services/Databases.kt @@ -14,14 +14,16 @@ import java.io.File class Databases(client: Client) : Service(client) { /** - * List databases - * * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name * @param search Search term to filter your list results. Max length: 256 chars. * @return [io.appwrite.models.DatabaseList] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.list` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.list") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun list( @@ -34,8 +36,7 @@ class Databases(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.DatabaseList = { io.appwrite.models.DatabaseList.from(map = it as Map) @@ -51,15 +52,18 @@ class Databases(client: Client) : Service(client) { } /** - * Create database - * * Create a new Database. + * * * @param databaseId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param name Database name. Max length: 128 chars. * @param enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @return [io.appwrite.models.Database] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createDatabase` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createDatabase") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun create( @@ -74,7 +78,7 @@ class Databases(client: Client) : Service(client) { "name" to name, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Database = { @@ -91,13 +95,15 @@ class Databases(client: Client) : Service(client) { } /** - * Get database - * * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. * * @param databaseId Database ID. * @return [io.appwrite.models.Database] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.get` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.get") + ) @Throws(AppwriteException::class) suspend fun get( databaseId: String, @@ -107,8 +113,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Database = { io.appwrite.models.Database.from(map = it as Map) @@ -124,8 +129,6 @@ class Databases(client: Client) : Service(client) { } /** - * Update database - * * Update a database by its unique ID. * * @param databaseId Database ID. @@ -133,6 +136,10 @@ class Databases(client: Client) : Service(client) { * @param enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @return [io.appwrite.models.Database] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.update") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun update( @@ -147,7 +154,7 @@ class Databases(client: Client) : Service(client) { "name" to name, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Database = { @@ -164,13 +171,15 @@ class Databases(client: Client) : Service(client) { } /** - * Delete database - * * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. * * @param databaseId Database ID. * @return [Any] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.delete` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.delete") + ) @Throws(AppwriteException::class) suspend fun delete( databaseId: String, @@ -180,7 +189,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -193,8 +202,6 @@ class Databases(client: Client) : Service(client) { } /** - * List collections - * * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. * * @param databaseId Database ID. @@ -202,6 +209,10 @@ class Databases(client: Client) : Service(client) { * @param search Search term to filter your list results. Max length: 256 chars. * @return [io.appwrite.models.CollectionList] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.listTables` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.listTables") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun listCollections( @@ -216,8 +227,7 @@ class Databases(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.CollectionList = { io.appwrite.models.CollectionList.from(map = it as Map) @@ -233,8 +243,6 @@ class Databases(client: Client) : Service(client) { } /** - * Create collection - * * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * * @param databaseId Database ID. @@ -245,6 +253,10 @@ class Databases(client: Client) : Service(client) { * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @return [io.appwrite.models.Collection] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createTable") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createCollection( @@ -265,7 +277,7 @@ class Databases(client: Client) : Service(client) { "documentSecurity" to documentSecurity, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Collection = { @@ -282,14 +294,16 @@ class Databases(client: Client) : Service(client) { } /** - * Get collection - * * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. * * @param databaseId Database ID. * @param collectionId Collection ID. * @return [io.appwrite.models.Collection] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.getTable` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.getTable") + ) @Throws(AppwriteException::class) suspend fun getCollection( databaseId: String, @@ -301,8 +315,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Collection = { io.appwrite.models.Collection.from(map = it as Map) @@ -318,8 +331,6 @@ class Databases(client: Client) : Service(client) { } /** - * Update collection - * * Update a collection by its unique ID. * * @param databaseId Database ID. @@ -330,6 +341,10 @@ class Databases(client: Client) : Service(client) { * @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @return [io.appwrite.models.Collection] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateTable") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateCollection( @@ -350,7 +365,7 @@ class Databases(client: Client) : Service(client) { "documentSecurity" to documentSecurity, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Collection = { @@ -367,14 +382,16 @@ class Databases(client: Client) : Service(client) { } /** - * Delete collection - * * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. * * @param databaseId Database ID. * @param collectionId Collection ID. * @return [Any] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTable` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.deleteTable") + ) @Throws(AppwriteException::class) suspend fun deleteCollection( databaseId: String, @@ -386,7 +403,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -399,15 +416,17 @@ class Databases(client: Client) : Service(client) { } /** - * List attributes - * * List attributes in the collection. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error * @return [io.appwrite.models.AttributeList] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.listColumns` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.listColumns") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun listAttributes( @@ -422,8 +441,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.AttributeList = { io.appwrite.models.AttributeList.from(map = it as Map) @@ -439,18 +457,21 @@ class Databases(client: Client) : Service(client) { } /** - * Create boolean attribute - * * Create a boolean attribute. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. * @param array Is attribute an array? * @return [io.appwrite.models.AttributeBoolean] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createBooleanColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createBooleanAttribute( @@ -471,7 +492,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "array" to array, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeBoolean = { @@ -488,18 +509,20 @@ class Databases(client: Client) : Service(client) { } /** - * Update boolean attribute - * * Update a boolean attribute. Changing the `default` value will not update already existing documents. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. * @param newKey New attribute key. * @return [io.appwrite.models.AttributeBoolean] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateBooleanColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateBooleanColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateBooleanAttribute( @@ -520,7 +543,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeBoolean = { @@ -537,18 +560,20 @@ class Databases(client: Client) : Service(client) { } /** - * Create datetime attribute - * * Create a date time attribute according to the ISO 8601 standard. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. * @param array Is attribute an array? * @return [io.appwrite.models.AttributeDatetime] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createDatetimeColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createDatetimeColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createDatetimeAttribute( @@ -569,7 +594,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "array" to array, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeDatetime = { @@ -586,18 +611,20 @@ class Databases(client: Client) : Service(client) { } /** - * Update dateTime attribute - * * Update a date time attribute. Changing the `default` value will not update already existing documents. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. * @param newKey New attribute key. * @return [io.appwrite.models.AttributeDatetime] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateDatetimeColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateDatetimeColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateDatetimeAttribute( @@ -618,7 +645,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeDatetime = { @@ -635,18 +662,21 @@ class Databases(client: Client) : Service(client) { } /** - * Create email attribute - * * Create an email attribute. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. * @param array Is attribute an array? * @return [io.appwrite.models.AttributeEmail] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createEmailColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createEmailColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createEmailAttribute( @@ -667,7 +697,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "array" to array, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeEmail = { @@ -684,18 +714,21 @@ class Databases(client: Client) : Service(client) { } /** - * Update email attribute - * * Update an email attribute. Changing the `default` value will not update already existing documents. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. - * @param newKey New attribute key. + * @param newKey New Attribute Key. * @return [io.appwrite.models.AttributeEmail] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateEmailColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateEmailColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateEmailAttribute( @@ -716,7 +749,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeEmail = { @@ -733,19 +766,22 @@ class Databases(client: Client) : Service(client) { } /** - * Create enum attribute - * - * Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. + * Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. - * @param elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. + * @param elements Array of enum values. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. * @param array Is attribute an array? * @return [io.appwrite.models.AttributeEnum] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createEnumColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createEnumColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createEnumAttribute( @@ -768,7 +804,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "array" to array, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeEnum = { @@ -785,19 +821,22 @@ class Databases(client: Client) : Service(client) { } /** - * Update enum attribute - * * Update an enum attribute. Changing the `default` value will not update already existing documents. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. - * @param elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. + * @param elements Updated list of enum values. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. - * @param newKey New attribute key. + * @param newKey New Attribute Key. * @return [io.appwrite.models.AttributeEnum] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateEnumColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateEnumColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateEnumAttribute( @@ -820,7 +859,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeEnum = { @@ -837,20 +876,23 @@ class Databases(client: Client) : Service(client) { } /** - * Create float attribute - * * Create a float attribute. Optionally, minimum and maximum values can be provided. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? - * @param min Minimum value to enforce on new documents - * @param max Maximum value to enforce on new documents - * @param default Default value for attribute when not provided. Cannot be set when attribute is required. + * @param min Minimum value. + * @param max Maximum value. + * @param default Default value. Cannot be set when required. * @param array Is attribute an array? * @return [io.appwrite.models.AttributeFloat] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createFloatColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createFloatAttribute( @@ -875,7 +917,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "array" to array, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeFloat = { @@ -892,20 +934,23 @@ class Databases(client: Client) : Service(client) { } /** - * Update float attribute - * * Update a float attribute. Changing the `default` value will not update already existing documents. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? - * @param min Minimum value to enforce on new documents - * @param max Maximum value to enforce on new documents - * @param default Default value for attribute when not provided. Cannot be set when attribute is required. - * @param newKey New attribute key. + * @param default Default value. Cannot be set when required. + * @param min Minimum value. + * @param max Maximum value. + * @param newKey New Attribute Key. * @return [io.appwrite.models.AttributeFloat] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateFloatColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateFloatAttribute( @@ -913,9 +958,9 @@ class Databases(client: Client) : Service(client) { collectionId: String, key: String, required: Boolean, - min: Double, - max: Double, default: Double? = null, + min: Double? = null, + max: Double? = null, newKey: String? = null, ): io.appwrite.models.AttributeFloat { val apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}" @@ -930,7 +975,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeFloat = { @@ -947,20 +992,23 @@ class Databases(client: Client) : Service(client) { } /** - * Create integer attribute - * * Create an integer attribute. Optionally, minimum and maximum values can be provided. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? - * @param min Minimum value to enforce on new documents - * @param max Maximum value to enforce on new documents - * @param default Default value for attribute when not provided. Cannot be set when attribute is required. + * @param min Minimum value + * @param max Maximum value + * @param default Default value. Cannot be set when attribute is required. * @param array Is attribute an array? * @return [io.appwrite.models.AttributeInteger] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createIntegerColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createIntegerAttribute( @@ -985,7 +1033,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "array" to array, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeInteger = { @@ -1002,20 +1050,23 @@ class Databases(client: Client) : Service(client) { } /** - * Update integer attribute - * * Update an integer attribute. Changing the `default` value will not update already existing documents. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? - * @param min Minimum value to enforce on new documents - * @param max Maximum value to enforce on new documents - * @param default Default value for attribute when not provided. Cannot be set when attribute is required. - * @param newKey New attribute key. + * @param default Default value. Cannot be set when attribute is required. + * @param min Minimum value + * @param max Maximum value + * @param newKey New Attribute Key. * @return [io.appwrite.models.AttributeInteger] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateIntegerColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateIntegerAttribute( @@ -1023,9 +1074,9 @@ class Databases(client: Client) : Service(client) { collectionId: String, key: String, required: Boolean, - min: Long, - max: Long, default: Long? = null, + min: Long? = null, + max: Long? = null, newKey: String? = null, ): io.appwrite.models.AttributeInteger { val apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}" @@ -1040,7 +1091,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeInteger = { @@ -1057,18 +1108,21 @@ class Databases(client: Client) : Service(client) { } /** - * Create IP address attribute - * * Create IP address attribute. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? - * @param default Default value for attribute when not provided. Cannot be set when attribute is required. + * @param default Default value. Cannot be set when attribute is required. * @param array Is attribute an array? * @return [io.appwrite.models.AttributeIp] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createIpColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createIpColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createIpAttribute( @@ -1089,7 +1143,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "array" to array, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeIp = { @@ -1106,18 +1160,21 @@ class Databases(client: Client) : Service(client) { } /** - * Update IP address attribute - * * Update an ip attribute. Changing the `default` value will not update already existing documents. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? - * @param default Default value for attribute when not provided. Cannot be set when attribute is required. - * @param newKey New attribute key. + * @param default Default value. Cannot be set when attribute is required. + * @param newKey New Attribute Key. * @return [io.appwrite.models.AttributeIp] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateIpColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateIpColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateIpAttribute( @@ -1138,7 +1195,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeIp = { @@ -1155,13 +1212,12 @@ class Databases(client: Client) : Service(client) { } /** - * Create relationship attribute - * * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param relatedCollectionId Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. + * @param relatedCollectionId Related Collection ID. * @param type Relation type * @param twoWay Is Two Way? * @param key Attribute Key. @@ -1169,6 +1225,10 @@ class Databases(client: Client) : Service(client) { * @param onDelete Constraints option * @return [io.appwrite.models.AttributeRelationship] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createRelationshipColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createRelationshipAttribute( @@ -1193,7 +1253,7 @@ class Databases(client: Client) : Service(client) { "twoWayKey" to twoWayKey, "onDelete" to onDelete, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeRelationship = { @@ -1210,12 +1270,11 @@ class Databases(client: Client) : Service(client) { } /** - * Create string attribute - * * Create a string attribute. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param key Attribute Key. * @param size Attribute size for text attributes, in number of characters. * @param required Is attribute required? @@ -1224,6 +1283,10 @@ class Databases(client: Client) : Service(client) { * @param encrypt Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. * @return [io.appwrite.models.AttributeString] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createStringColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createStringAttribute( @@ -1248,7 +1311,7 @@ class Databases(client: Client) : Service(client) { "array" to array, "encrypt" to encrypt, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeString = { @@ -1265,19 +1328,22 @@ class Databases(client: Client) : Service(client) { } /** - * Update string attribute - * * Update a string attribute. Changing the `default` value will not update already existing documents. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. * @param size Maximum size of the string attribute. - * @param newKey New attribute key. + * @param newKey New Attribute Key. * @return [io.appwrite.models.AttributeString] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateStringColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateStringAttribute( @@ -1300,7 +1366,7 @@ class Databases(client: Client) : Service(client) { "size" to size, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeString = { @@ -1317,18 +1383,21 @@ class Databases(client: Client) : Service(client) { } /** - * Create URL attribute - * * Create a URL attribute. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. * @param array Is attribute an array? * @return [io.appwrite.models.AttributeUrl] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createUrlColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createUrlColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createUrlAttribute( @@ -1349,7 +1418,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "array" to array, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeUrl = { @@ -1366,18 +1435,21 @@ class Databases(client: Client) : Service(client) { } /** - * Update URL attribute - * * Update an url attribute. Changing the `default` value will not update already existing documents. + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param required Is attribute required? * @param default Default value for attribute when not provided. Cannot be set when attribute is required. - * @param newKey New attribute key. + * @param newKey New Attribute Key. * @return [io.appwrite.models.AttributeUrl] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateUrlColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateUrlColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateUrlAttribute( @@ -1398,7 +1470,7 @@ class Databases(client: Client) : Service(client) { "default" to default, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeUrl = { @@ -1415,15 +1487,17 @@ class Databases(client: Client) : Service(client) { } /** - * Get attribute - * * Get attribute by ID. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @return [Any] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.getColumn") + ) @Throws(AppwriteException::class) suspend fun getAttribute( databaseId: String, @@ -1437,8 +1511,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -1450,15 +1523,17 @@ class Databases(client: Client) : Service(client) { } /** - * Delete attribute - * * Deletes an attribute. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @return [Any] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.deleteColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.deleteColumn") + ) @Throws(AppwriteException::class) suspend fun deleteAttribute( databaseId: String, @@ -1472,7 +1547,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -1485,17 +1560,20 @@ class Databases(client: Client) : Service(client) { } /** - * Update relationship attribute - * * Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + * * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param collectionId Collection ID. * @param key Attribute Key. * @param onDelete Constraints option - * @param newKey New attribute key. + * @param newKey New Attribute Key. * @return [io.appwrite.models.AttributeRelationship] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateRelationshipColumn") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateRelationshipAttribute( @@ -1514,7 +1592,7 @@ class Databases(client: Client) : Service(client) { "onDelete" to onDelete, "newKey" to newKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.AttributeRelationship = { @@ -1531,15 +1609,17 @@ class Databases(client: Client) : Service(client) { } /** - * List documents - * - * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. * * @param databaseId Database ID. * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @return [io.appwrite.models.DocumentList] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.listRows") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun listDocuments( @@ -1555,8 +1635,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.DocumentList = { io.appwrite.models.DocumentList.from(map = it as Map, nestedType) @@ -1572,15 +1651,17 @@ class Databases(client: Client) : Service(client) { } /** - * List documents - * - * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. * * @param databaseId Database ID. * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @return [io.appwrite.models.DocumentList] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.listRows") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun listDocuments( @@ -1595,8 +1676,6 @@ class Databases(client: Client) : Service(client) { ) /** - * Create document - * * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * * @param databaseId Database ID. @@ -1606,6 +1685,10 @@ class Databases(client: Client) : Service(client) { * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @return [io.appwrite.models.Document] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createRow") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createDocument( @@ -1625,7 +1708,7 @@ class Databases(client: Client) : Service(client) { "data" to data, "permissions" to permissions, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Document = { @@ -1642,8 +1725,6 @@ class Databases(client: Client) : Service(client) { } /** - * Create document - * * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * * @param databaseId Database ID. @@ -1653,6 +1734,10 @@ class Databases(client: Client) : Service(client) { * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @return [io.appwrite.models.Document] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createRow") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createDocument( @@ -1671,41 +1756,39 @@ class Databases(client: Client) : Service(client) { ) /** - * Get document - * - * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @return [io.appwrite.models.Document] + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documents Array of documents data as JSON objects. + * @return [io.appwrite.models.DocumentList] */ - @JvmOverloads + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createRows") + ) @Throws(AppwriteException::class) - suspend fun getDocument( + suspend fun createDocuments( databaseId: String, collectionId: String, - documentId: String, - queries: List? = null, + documents: List, nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" + ): io.appwrite.models.DocumentList { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .replace("{databaseId}", databaseId) .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) val apiParams = mutableMapOf( - "queries" to queries, + "documents" to documents, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) } return client.call( - "GET", + "POST", apiPath, apiHeaders, apiParams, @@ -1715,70 +1798,64 @@ class Databases(client: Client) : Service(client) { } /** - * Get document - * - * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @return [io.appwrite.models.Document] + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param documents Array of documents data as JSON objects. + * @return [io.appwrite.models.DocumentList] */ - @JvmOverloads + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createRows") + ) @Throws(AppwriteException::class) - suspend fun getDocument( + suspend fun createDocuments( databaseId: String, collectionId: String, - documentId: String, - queries: List? = null, - ): io.appwrite.models.Document> = getDocument( + documents: List, + ): io.appwrite.models.DocumentList> = createDocuments( databaseId, collectionId, - documentId, - queries, + documents, nestedType = classOf(), ) /** - * Update document - * - * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + * * * @param databaseId Database ID. * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include only attribute and value pairs to be updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @return [io.appwrite.models.Document] + * @param documents Array of document data as JSON objects. May contain partial documents. + * @return [io.appwrite.models.DocumentList] */ - @JvmOverloads + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.upsertRows") + ) @Throws(AppwriteException::class) - suspend fun updateDocument( + suspend fun upsertDocuments( databaseId: String, collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, + documents: List, nestedType: Class, - ): io.appwrite.models.Document { - val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" + ): io.appwrite.models.DocumentList { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .replace("{databaseId}", databaseId) .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) val apiParams = mutableMapOf( - "data" to data, - "permissions" to permissions, + "documents" to documents, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) - val converter: (Any) -> io.appwrite.models.Document = { - io.appwrite.models.Document.from(map = it as Map, nestedType) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) } return client.call( - "PATCH", + "PUT", apiPath, apiHeaders, apiParams, @@ -1788,79 +1865,626 @@ class Databases(client: Client) : Service(client) { } /** - * Update document - * - * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + * * * @param databaseId Database ID. * @param collectionId Collection ID. - * @param documentId Document ID. - * @param data Document data as JSON object. Include only attribute and value pairs to be updated. - * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @return [io.appwrite.models.Document] + * @param documents Array of document data as JSON objects. May contain partial documents. + * @return [io.appwrite.models.DocumentList] */ - @JvmOverloads + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.upsertRows") + ) @Throws(AppwriteException::class) - suspend fun updateDocument( + suspend fun upsertDocuments( databaseId: String, collectionId: String, - documentId: String, - data: Any? = null, - permissions: List? = null, - ): io.appwrite.models.Document> = updateDocument( + documents: List, + ): io.appwrite.models.DocumentList> = upsertDocuments( databaseId, collectionId, - documentId, - data, - permissions, + documents, nestedType = classOf(), ) /** - * Delete document - * - * Delete a document by its unique ID. + * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. * * @param databaseId Database ID. - * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param documentId Document ID. - * @return [Any] + * @param collectionId Collection ID. + * @param data Document data as JSON object. Include only attribute and value pairs to be updated. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.DocumentList] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateRows") + ) + @JvmOverloads @Throws(AppwriteException::class) - suspend fun deleteDocument( + suspend fun updateDocuments( databaseId: String, collectionId: String, - documentId: String, - ): Any { - val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" + data: Any? = null, + queries: List? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" .replace("{databaseId}", databaseId) .replace("{collectionId}", collectionId) - .replace("{documentId}", documentId) val apiParams = mutableMapOf( + "data" to data, + "queries" to queries, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } return client.call( - "DELETE", + "PATCH", apiPath, apiHeaders, apiParams, - responseType = Any::class.java, + responseType = classOf(), + converter, ) } /** - * List indexes + * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. * - * List indexes in the collection. + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param data Document data as JSON object. Include only attribute and value pairs to be updated. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.DocumentList] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateRows") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocuments( + databaseId: String, + collectionId: String, + data: Any? = null, + queries: List? = null, + ): io.appwrite.models.DocumentList> = updateDocuments( + databaseId, + collectionId, + data, + queries, + nestedType = classOf(), + ) + + /** + * Bulk delete documents using queries, if no queries are passed then all documents are deleted. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.DocumentList] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.deleteRows") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + nestedType: Class, + ): io.appwrite.models.DocumentList { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.DocumentList = { + io.appwrite.models.DocumentList.from(map = it as Map, nestedType) + } + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Bulk delete documents using queries, if no queries are passed then all documents are deleted. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.DocumentList] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRows` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.deleteRows") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteDocuments( + databaseId: String, + collectionId: String, + queries: List? = null, + ): io.appwrite.models.DocumentList> = deleteDocuments( + databaseId, + collectionId, + queries, + nestedType = classOf(), + ) + + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.getRow") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getDocument( + databaseId: String, + collectionId: String, + documentId: String, + queries: List? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.getRow") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getDocument( + databaseId: String, + collectionId: String, + documentId: String, + queries: List? = null, + ): io.appwrite.models.Document> = getDocument( + databaseId, + collectionId, + documentId, + queries, + nestedType = classOf(), + ) + + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include all required attributes of the document to be created or updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.upsertRow") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any, + permissions: List? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "data" to data, + "permissions" to permissions, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include all required attributes of the document to be created or updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.upsertRow") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any, + permissions: List? = null, + ): io.appwrite.models.Document> = upsertDocument( + databaseId, + collectionId, + documentId, + data, + permissions, + nestedType = classOf(), + ) + + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include only attribute and value pairs to be updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateRow") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + "data" to data, + "permissions" to permissions, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param data Document data as JSON object. Include only attribute and value pairs to be updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.updateRow") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDocument( + databaseId: String, + collectionId: String, + documentId: String, + data: Any? = null, + permissions: List? = null, + ): io.appwrite.models.Document> = updateDocument( + databaseId, + collectionId, + documentId, + data, + permissions, + nestedType = classOf(), + ) + + /** + * Delete a document by its unique ID. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param documentId Document ID. + * @return [Any] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.deleteRow") + ) + @Throws(AppwriteException::class) + suspend fun deleteDocument( + databaseId: String, + collectionId: String, + documentId: String, + ): Any { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Decrement a specific attribute of a document by a given value. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param attribute Attribute key. + * @param value Value to increment the attribute by. The value must be a number. + * @param min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.decrementRowColumn") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun decrementDocumentAttribute( + databaseId: String, + collectionId: String, + documentId: String, + attribute: String, + value: Double? = null, + min: Double? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + .replace("{attribute}", attribute) + + val apiParams = mutableMapOf( + "value" to value, + "min" to min, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Decrement a specific attribute of a document by a given value. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param attribute Attribute key. + * @param value Value to increment the attribute by. The value must be a number. + * @param min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.decrementRowColumn") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun decrementDocumentAttribute( + databaseId: String, + collectionId: String, + documentId: String, + attribute: String, + value: Double? = null, + min: Double? = null, + ): io.appwrite.models.Document> = decrementDocumentAttribute( + databaseId, + collectionId, + documentId, + attribute, + value, + min, + nestedType = classOf(), + ) + + /** + * Increment a specific attribute of a document by a given value. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param attribute Attribute key. + * @param value Value to increment the attribute by. The value must be a number. + * @param max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.incrementRowColumn") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun incrementDocumentAttribute( + databaseId: String, + collectionId: String, + documentId: String, + attribute: String, + value: Double? = null, + max: Double? = null, + nestedType: Class, + ): io.appwrite.models.Document { + val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment" + .replace("{databaseId}", databaseId) + .replace("{collectionId}", collectionId) + .replace("{documentId}", documentId) + .replace("{attribute}", attribute) + + val apiParams = mutableMapOf( + "value" to value, + "max" to max, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Document = { + io.appwrite.models.Document.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Increment a specific attribute of a document by a given value. + * + * @param databaseId Database ID. + * @param collectionId Collection ID. + * @param documentId Document ID. + * @param attribute Attribute key. + * @param value Value to increment the attribute by. The value must be a number. + * @param max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @return [io.appwrite.models.Document] + */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.incrementRowColumn") + ) + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun incrementDocumentAttribute( + databaseId: String, + collectionId: String, + documentId: String, + attribute: String, + value: Double? = null, + max: Double? = null, + ): io.appwrite.models.Document> = incrementDocumentAttribute( + databaseId, + collectionId, + documentId, + attribute, + value, + max, + nestedType = classOf(), + ) + + /** + * List indexes in the collection. * * @param databaseId Database ID. * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error * @return [io.appwrite.models.IndexList] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.listIndexes` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.listIndexes") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun listIndexes( @@ -1875,8 +2499,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.IndexList = { io.appwrite.models.IndexList.from(map = it as Map) @@ -1892,9 +2515,8 @@ class Databases(client: Client) : Service(client) { } /** - * Create index - * - * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.Attributes can be `key`, `fulltext`, and `unique`. + * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. + * Attributes can be `key`, `fulltext`, and `unique`. * * @param databaseId Database ID. * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). @@ -1902,8 +2524,13 @@ class Databases(client: Client) : Service(client) { * @param type Index type. * @param attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param orders Array of index orders. Maximum of 100 orders are allowed. + * @param lengths Length of index. Maximum of 100 * @return [io.appwrite.models.Index] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.createIndex") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createIndex( @@ -1913,6 +2540,7 @@ class Databases(client: Client) : Service(client) { type: io.appwrite.enums.IndexType, attributes: List, orders: List? = null, + lengths: List? = null, ): io.appwrite.models.Index { val apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" .replace("{databaseId}", databaseId) @@ -1923,8 +2551,9 @@ class Databases(client: Client) : Service(client) { "type" to type, "attributes" to attributes, "orders" to orders, + "lengths" to lengths, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Index = { @@ -1941,8 +2570,6 @@ class Databases(client: Client) : Service(client) { } /** - * Get index - * * Get index by ID. * * @param databaseId Database ID. @@ -1950,6 +2577,10 @@ class Databases(client: Client) : Service(client) { * @param key Index Key. * @return [io.appwrite.models.Index] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.getIndex` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.getIndex") + ) @Throws(AppwriteException::class) suspend fun getIndex( databaseId: String, @@ -1963,8 +2594,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Index = { io.appwrite.models.Index.from(map = it as Map) @@ -1980,8 +2610,6 @@ class Databases(client: Client) : Service(client) { } /** - * Delete index - * * Delete an index. * * @param databaseId Database ID. @@ -1989,6 +2617,10 @@ class Databases(client: Client) : Service(client) { * @param key Index Key. * @return [Any] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `TablesDB.deleteIndex` instead.", + replaceWith = ReplaceWith("io.appwrite.services.TablesDB.deleteIndex") + ) @Throws(AppwriteException::class) suspend fun deleteIndex( databaseId: String, @@ -2002,7 +2634,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( diff --git a/src/main/kotlin/io/appwrite/services/Functions.kt b/src/main/kotlin/io/appwrite/services/Functions.kt index d0a98f5..354a07b 100644 --- a/src/main/kotlin/io/appwrite/services/Functions.kt +++ b/src/main/kotlin/io/appwrite/services/Functions.kt @@ -16,11 +16,9 @@ import java.io.File class Functions(client: Client) : Service(client) { /** - * List functions + * Get a list of all the project's functions. You can use the query params to filter your results. * - * Get a list of all the project's functions. You can use the query params to filter your results. - * - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId * @param search Search term to filter your list results. Max length: 256 chars. * @return [io.appwrite.models.FunctionList] */ @@ -36,8 +34,7 @@ class Functions(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.FunctionList = { io.appwrite.models.FunctionList.from(map = it as Map) @@ -53,8 +50,6 @@ class Functions(client: Client) : Service(client) { } /** - * Create function - * * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. * * @param functionId Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -65,7 +60,7 @@ class Functions(client: Client) : Service(client) { * @param schedule Schedule CRON syntax. * @param timeout Function maximum execution time in seconds. * @param enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. - * @param logging Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + * @param logging When disabled, executions will exclude logs and errors, and will be slightly faster. * @param entrypoint Entrypoint File. This path is relative to the "providerRootDirectory". * @param commands Build Commands. * @param scopes List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. @@ -74,10 +69,6 @@ class Functions(client: Client) : Service(client) { * @param providerBranch Production branch for the repo linked to the function. * @param providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param providerRootDirectory Path to function code in the linked repo. - * @param templateRepository Repository name of the template. - * @param templateOwner The name of the owner of the template. - * @param templateRootDirectory Path to function code in the template repo. - * @param templateVersion Version (tag) for the repo linked to the function template. * @param specification Runtime specification for the function and builds. * @return [io.appwrite.models.Function] */ @@ -101,10 +92,6 @@ class Functions(client: Client) : Service(client) { providerBranch: String? = null, providerSilentMode: Boolean? = null, providerRootDirectory: String? = null, - templateRepository: String? = null, - templateOwner: String? = null, - templateRootDirectory: String? = null, - templateVersion: String? = null, specification: String? = null, ): io.appwrite.models.Function { val apiPath = "/functions" @@ -127,13 +114,9 @@ class Functions(client: Client) : Service(client) { "providerBranch" to providerBranch, "providerSilentMode" to providerSilentMode, "providerRootDirectory" to providerRootDirectory, - "templateRepository" to templateRepository, - "templateOwner" to templateOwner, - "templateRootDirectory" to templateRootDirectory, - "templateVersion" to templateVersion, "specification" to specification, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Function = { @@ -150,8 +133,6 @@ class Functions(client: Client) : Service(client) { } /** - * List runtimes - * * Get a list of all runtimes that are currently active on your instance. * * @return [io.appwrite.models.RuntimeList] @@ -163,8 +144,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.RuntimeList = { io.appwrite.models.RuntimeList.from(map = it as Map) @@ -180,8 +160,6 @@ class Functions(client: Client) : Service(client) { } /** - * List available function runtime specifications - * * List allowed function specifications for this instance. * * @return [io.appwrite.models.SpecificationList] @@ -193,8 +171,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.SpecificationList = { io.appwrite.models.SpecificationList.from(map = it as Map) @@ -210,8 +187,6 @@ class Functions(client: Client) : Service(client) { } /** - * Get function - * * Get a function by its unique ID. * * @param functionId Function ID. @@ -226,8 +201,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Function = { io.appwrite.models.Function.from(map = it as Map) @@ -243,8 +217,6 @@ class Functions(client: Client) : Service(client) { } /** - * Update function - * * Update function by its unique ID. * * @param functionId Function ID. @@ -255,7 +227,7 @@ class Functions(client: Client) : Service(client) { * @param schedule Schedule CRON syntax. * @param timeout Maximum execution time in seconds. * @param enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. - * @param logging Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + * @param logging When disabled, executions will exclude logs and errors, and will be slightly faster. * @param entrypoint Entrypoint File. This path is relative to the "providerRootDirectory". * @param commands Build Commands. * @param scopes List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. @@ -311,7 +283,7 @@ class Functions(client: Client) : Service(client) { "providerRootDirectory" to providerRootDirectory, "specification" to specification, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Function = { @@ -328,8 +300,6 @@ class Functions(client: Client) : Service(client) { } /** - * Delete function - * * Delete a function by its unique ID. * * @param functionId Function ID. @@ -344,7 +314,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -357,12 +327,44 @@ class Functions(client: Client) : Service(client) { } /** - * List deployments + * Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function. * - * Get a list of all the project's code deployments. You can use the query params to filter your results. + * @param functionId Function ID. + * @param deploymentId Deployment ID. + * @return [io.appwrite.models.Function] + */ + @Throws(AppwriteException::class) + suspend fun updateFunctionDeployment( + functionId: String, + deploymentId: String, + ): io.appwrite.models.Function { + val apiPath = "/functions/{functionId}/deployment" + .replace("{functionId}", functionId) + + val apiParams = mutableMapOf( + "deploymentId" to deploymentId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Function = { + io.appwrite.models.Function.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Function::class.java, + converter, + ) + } + + /** + * Get a list of all the function's code deployments. You can use the query params to filter your results. * * @param functionId Function ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: size, buildId, activate, entrypoint, commands, type, size + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type * @param search Search term to filter your list results. Max length: 256 chars. * @return [io.appwrite.models.DeploymentList] */ @@ -380,8 +382,7 @@ class Functions(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.DeploymentList = { io.appwrite.models.DeploymentList.from(map = it as Map) @@ -397,9 +398,11 @@ class Functions(client: Client) : Service(client) { } /** - * Create deployment - * - * Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).Use the "command" param to set the entrypoint used to execute your code. + * Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. + * + * This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions). + * + * Use the "command" param to set the entrypoint used to execute your code. * * @param functionId Function ID. * @param code Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. @@ -427,7 +430,7 @@ class Functions(client: Client) : Service(client) { "code" to code, "activate" to activate, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "multipart/form-data", ) val converter: (Any) -> io.appwrite.models.Deployment = { @@ -448,33 +451,35 @@ class Functions(client: Client) : Service(client) { } /** - * Get deployment - * - * Get a code deployment by its unique ID. + * Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. * * @param functionId Function ID. * @param deploymentId Deployment ID. + * @param buildId Build unique ID. * @return [io.appwrite.models.Deployment] */ + @JvmOverloads @Throws(AppwriteException::class) - suspend fun getDeployment( + suspend fun createDuplicateDeployment( functionId: String, deploymentId: String, + buildId: String? = null, ): io.appwrite.models.Deployment { - val apiPath = "/functions/{functionId}/deployments/{deploymentId}" + val apiPath = "/functions/{functionId}/deployments/duplicate" .replace("{functionId}", functionId) - .replace("{deploymentId}", deploymentId) val apiParams = mutableMapOf( + "deploymentId" to deploymentId, + "buildId" to buildId, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Deployment = { io.appwrite.models.Deployment.from(map = it as Map) } return client.call( - "GET", + "POST", apiPath, apiHeaders, apiParams, @@ -484,167 +489,183 @@ class Functions(client: Client) : Service(client) { } /** - * Update deployment - * - * Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint. + * Create a deployment based on a template. + * + * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. * * @param functionId Function ID. - * @param deploymentId Deployment ID. - * @return [io.appwrite.models.Function] + * @param repository Repository name of the template. + * @param owner The name of the owner of the template. + * @param rootDirectory Path to function code in the template repo. + * @param version Version (tag) for the repo linked to the function template. + * @param activate Automatically activate the deployment when it is finished building. + * @return [io.appwrite.models.Deployment] */ + @JvmOverloads @Throws(AppwriteException::class) - suspend fun updateDeployment( + suspend fun createTemplateDeployment( functionId: String, - deploymentId: String, - ): io.appwrite.models.Function { - val apiPath = "/functions/{functionId}/deployments/{deploymentId}" + repository: String, + owner: String, + rootDirectory: String, + version: String, + activate: Boolean? = null, + ): io.appwrite.models.Deployment { + val apiPath = "/functions/{functionId}/deployments/template" .replace("{functionId}", functionId) - .replace("{deploymentId}", deploymentId) val apiParams = mutableMapOf( + "repository" to repository, + "owner" to owner, + "rootDirectory" to rootDirectory, + "version" to version, + "activate" to activate, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) - val converter: (Any) -> io.appwrite.models.Function = { - io.appwrite.models.Function.from(map = it as Map) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) } return client.call( - "PATCH", + "POST", apiPath, apiHeaders, apiParams, - responseType = io.appwrite.models.Function::class.java, + responseType = io.appwrite.models.Deployment::class.java, converter, ) } /** - * Delete deployment - * - * Delete a code deployment by its unique ID. + * Create a deployment when a function is connected to VCS. + * + * This endpoint lets you create deployment from a branch, commit, or a tag. * * @param functionId Function ID. - * @param deploymentId Deployment ID. - * @return [Any] + * @param type Type of reference passed. Allowed values are: branch, commit + * @param reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash + * @param activate Automatically activate the deployment when it is finished building. + * @return [io.appwrite.models.Deployment] */ + @JvmOverloads @Throws(AppwriteException::class) - suspend fun deleteDeployment( + suspend fun createVcsDeployment( functionId: String, - deploymentId: String, - ): Any { - val apiPath = "/functions/{functionId}/deployments/{deploymentId}" + type: io.appwrite.enums.VCSDeploymentType, + reference: String, + activate: Boolean? = null, + ): io.appwrite.models.Deployment { + val apiPath = "/functions/{functionId}/deployments/vcs" .replace("{functionId}", functionId) - .replace("{deploymentId}", deploymentId) val apiParams = mutableMapOf( + "type" to type, + "reference" to reference, + "activate" to activate, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } return client.call( - "DELETE", + "POST", apiPath, apiHeaders, apiParams, - responseType = Any::class.java, + responseType = io.appwrite.models.Deployment::class.java, + converter, ) } /** - * Rebuild deployment - * - * + * Get a function deployment by its unique ID. * * @param functionId Function ID. * @param deploymentId Deployment ID. - * @param buildId Build unique ID. - * @return [Any] + * @return [io.appwrite.models.Deployment] */ - @JvmOverloads @Throws(AppwriteException::class) - suspend fun createBuild( + suspend fun getDeployment( functionId: String, deploymentId: String, - buildId: String? = null, - ): Any { - val apiPath = "/functions/{functionId}/deployments/{deploymentId}/build" + ): io.appwrite.models.Deployment { + val apiPath = "/functions/{functionId}/deployments/{deploymentId}" .replace("{functionId}", functionId) .replace("{deploymentId}", deploymentId) val apiParams = mutableMapOf( - "buildId" to buildId, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } return client.call( - "POST", + "GET", apiPath, apiHeaders, apiParams, - responseType = Any::class.java, + responseType = io.appwrite.models.Deployment::class.java, + converter, ) } /** - * Cancel deployment - * - * + * Delete a code deployment by its unique ID. * * @param functionId Function ID. * @param deploymentId Deployment ID. - * @return [io.appwrite.models.Build] + * @return [Any] */ @Throws(AppwriteException::class) - suspend fun updateDeploymentBuild( + suspend fun deleteDeployment( functionId: String, deploymentId: String, - ): io.appwrite.models.Build { - val apiPath = "/functions/{functionId}/deployments/{deploymentId}/build" + ): Any { + val apiPath = "/functions/{functionId}/deployments/{deploymentId}" .replace("{functionId}", functionId) .replace("{deploymentId}", deploymentId) val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) - val converter: (Any) -> io.appwrite.models.Build = { - io.appwrite.models.Build.from(map = it as Map) - } return client.call( - "PATCH", + "DELETE", apiPath, apiHeaders, apiParams, - responseType = io.appwrite.models.Build::class.java, - converter, + responseType = Any::class.java, ) } /** - * Download deployment - * - * Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. + * Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. * * @param functionId Function ID. * @param deploymentId Deployment ID. + * @param type Deployment file to download. Can be: "source", "output". * @return [ByteArray] */ + @JvmOverloads @Throws(AppwriteException::class) suspend fun getDeploymentDownload( functionId: String, deploymentId: String, + type: io.appwrite.enums.DeploymentDownloadType? = null, ): ByteArray { val apiPath = "/functions/{functionId}/deployments/{deploymentId}/download" .replace("{functionId}", functionId) .replace("{deploymentId}", deploymentId) val apiParams = mutableMapOf( + "type" to type, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -655,13 +676,44 @@ class Functions(client: Client) : Service(client) { } /** - * List executions + * Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. * + * @param functionId Function ID. + * @param deploymentId Deployment ID. + * @return [io.appwrite.models.Deployment] + */ + @Throws(AppwriteException::class) + suspend fun updateDeploymentStatus( + functionId: String, + deploymentId: String, + ): io.appwrite.models.Deployment { + val apiPath = "/functions/{functionId}/deployments/{deploymentId}/status" + .replace("{functionId}", functionId) + .replace("{deploymentId}", deploymentId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Deployment::class.java, + converter, + ) + } + + /** * Get a list of all the current user function execution logs. You can use the query params to filter your results. * * @param functionId Function ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId - * @param search Search term to filter your list results. Max length: 256 chars. * @return [io.appwrite.models.ExecutionList] */ @JvmOverloads @@ -669,17 +721,14 @@ class Functions(client: Client) : Service(client) { suspend fun listExecutions( functionId: String, queries: List? = null, - search: String? = null, ): io.appwrite.models.ExecutionList { val apiPath = "/functions/{functionId}/executions" .replace("{functionId}", functionId) val apiParams = mutableMapOf( "queries" to queries, - "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.ExecutionList = { io.appwrite.models.ExecutionList.from(map = it as Map) @@ -695,8 +744,6 @@ class Functions(client: Client) : Service(client) { } /** - * Create execution - * * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. * * @param functionId Function ID. @@ -730,7 +777,7 @@ class Functions(client: Client) : Service(client) { "headers" to headers, "scheduledAt" to scheduledAt, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Execution = { @@ -747,8 +794,6 @@ class Functions(client: Client) : Service(client) { } /** - * Get execution - * * Get a function execution log by its unique ID. * * @param functionId Function ID. @@ -766,8 +811,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Execution = { io.appwrite.models.Execution.from(map = it as Map) @@ -783,8 +827,6 @@ class Functions(client: Client) : Service(client) { } /** - * Delete execution - * * Delete a function execution by its unique ID. * * @param functionId Function ID. @@ -802,7 +844,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -815,8 +857,6 @@ class Functions(client: Client) : Service(client) { } /** - * List variables - * * Get a list of all variables of a specific function. * * @param functionId Function unique ID. @@ -831,8 +871,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.VariableList = { io.appwrite.models.VariableList.from(map = it as Map) @@ -848,20 +887,21 @@ class Functions(client: Client) : Service(client) { } /** - * Create variable - * * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. * * @param functionId Function unique ID. * @param key Variable key. Max length: 255 chars. * @param value Variable value. Max length: 8192 chars. + * @param secret Secret variables can be updated or deleted, but only functions can read them during build and runtime. * @return [io.appwrite.models.Variable] */ + @JvmOverloads @Throws(AppwriteException::class) suspend fun createVariable( functionId: String, key: String, value: String, + secret: Boolean? = null, ): io.appwrite.models.Variable { val apiPath = "/functions/{functionId}/variables" .replace("{functionId}", functionId) @@ -869,8 +909,9 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( "key" to key, "value" to value, + "secret" to secret, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Variable = { @@ -887,8 +928,6 @@ class Functions(client: Client) : Service(client) { } /** - * Get variable - * * Get a variable by its unique ID. * * @param functionId Function unique ID. @@ -906,8 +945,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Variable = { io.appwrite.models.Variable.from(map = it as Map) @@ -923,14 +961,13 @@ class Functions(client: Client) : Service(client) { } /** - * Update variable - * * Update variable by its unique ID. * * @param functionId Function unique ID. * @param variableId Variable unique ID. * @param key Variable key. Max length: 255 chars. * @param value Variable value. Max length: 8192 chars. + * @param secret Secret variables can be updated or deleted, but only functions can read them during build and runtime. * @return [io.appwrite.models.Variable] */ @JvmOverloads @@ -940,6 +977,7 @@ class Functions(client: Client) : Service(client) { variableId: String, key: String, value: String? = null, + secret: Boolean? = null, ): io.appwrite.models.Variable { val apiPath = "/functions/{functionId}/variables/{variableId}" .replace("{functionId}", functionId) @@ -948,8 +986,9 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( "key" to key, "value" to value, + "secret" to secret, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Variable = { @@ -966,8 +1005,6 @@ class Functions(client: Client) : Service(client) { } /** - * Delete variable - * * Delete a variable by its unique ID. * * @param functionId Function unique ID. @@ -985,7 +1022,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( diff --git a/src/main/kotlin/io/appwrite/services/Graphql.kt b/src/main/kotlin/io/appwrite/services/Graphql.kt index d8a676c..c32b546 100644 --- a/src/main/kotlin/io/appwrite/services/Graphql.kt +++ b/src/main/kotlin/io/appwrite/services/Graphql.kt @@ -14,8 +14,6 @@ import java.io.File class Graphql(client: Client) : Service(client) { /** - * GraphQL endpoint - * * Execute a GraphQL mutation. * * @param query The query or queries to execute. @@ -30,7 +28,7 @@ class Graphql(client: Client) : Service(client) { val apiParams = mutableMapOf( "query" to query, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "x-sdk-graphql" to "true", "content-type" to "application/json", ) @@ -48,8 +46,6 @@ class Graphql(client: Client) : Service(client) { } /** - * GraphQL endpoint - * * Execute a GraphQL mutation. * * @param query The query or queries to execute. @@ -64,7 +60,7 @@ class Graphql(client: Client) : Service(client) { val apiParams = mutableMapOf( "query" to query, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "x-sdk-graphql" to "true", "content-type" to "application/json", ) diff --git a/src/main/kotlin/io/appwrite/services/Health.kt b/src/main/kotlin/io/appwrite/services/Health.kt index a566692..f8d9cbf 100644 --- a/src/main/kotlin/io/appwrite/services/Health.kt +++ b/src/main/kotlin/io/appwrite/services/Health.kt @@ -9,13 +9,11 @@ import okhttp3.Cookie import java.io.File /** - * The Health service allows you to both validate and monitor your Appwrite server's health. + * The Health service allows you to both validate and monitor your Appwrite server's health. **/ class Health(client: Client) : Service(client) { /** - * Get HTTP - * * Check the Appwrite HTTP server is up and responsive. * * @return [io.appwrite.models.HealthStatus] @@ -27,8 +25,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthStatus = { io.appwrite.models.HealthStatus.from(map = it as Map) @@ -44,8 +41,6 @@ class Health(client: Client) : Service(client) { } /** - * Get antivirus - * * Check the Appwrite Antivirus server is up and connection is successful. * * @return [io.appwrite.models.HealthAntivirus] @@ -57,8 +52,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthAntivirus = { io.appwrite.models.HealthAntivirus.from(map = it as Map) @@ -74,8 +68,6 @@ class Health(client: Client) : Service(client) { } /** - * Get cache - * * Check the Appwrite in-memory cache servers are up and connection is successful. * * @return [io.appwrite.models.HealthStatus] @@ -87,8 +79,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthStatus = { io.appwrite.models.HealthStatus.from(map = it as Map) @@ -104,8 +95,6 @@ class Health(client: Client) : Service(client) { } /** - * Get the SSL certificate for a domain - * * Get the SSL certificate for a domain * * @param domain string @@ -121,8 +110,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "domain" to domain, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthCertificate = { io.appwrite.models.HealthCertificate.from(map = it as Map) @@ -138,8 +126,6 @@ class Health(client: Client) : Service(client) { } /** - * Get DB - * * Check the Appwrite database servers are up and connection is successful. * * @return [io.appwrite.models.HealthStatus] @@ -151,8 +137,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthStatus = { io.appwrite.models.HealthStatus.from(map = it as Map) @@ -168,8 +153,6 @@ class Health(client: Client) : Service(client) { } /** - * Get pubsub - * * Check the Appwrite pub-sub servers are up and connection is successful. * * @return [io.appwrite.models.HealthStatus] @@ -181,8 +164,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthStatus = { io.appwrite.models.HealthStatus.from(map = it as Map) @@ -198,38 +180,6 @@ class Health(client: Client) : Service(client) { } /** - * Get queue - * - * Check the Appwrite queue messaging servers are up and connection is successful. - * - * @return [io.appwrite.models.HealthStatus] - */ - @Throws(AppwriteException::class) - suspend fun getQueue( - ): io.appwrite.models.HealthStatus { - val apiPath = "/health/queue" - - val apiParams = mutableMapOf( - ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", - ) - val converter: (Any) -> io.appwrite.models.HealthStatus = { - io.appwrite.models.HealthStatus.from(map = it as Map) - } - return client.call( - "GET", - apiPath, - apiHeaders, - apiParams, - responseType = io.appwrite.models.HealthStatus::class.java, - converter, - ) - } - - /** - * Get builds queue - * * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -245,8 +195,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -262,8 +211,6 @@ class Health(client: Client) : Service(client) { } /** - * Get certificates queue - * * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -279,8 +226,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -296,8 +242,6 @@ class Health(client: Client) : Service(client) { } /** - * Get databases queue - * * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. * * @param name Queue name for which to check the queue size @@ -316,8 +260,7 @@ class Health(client: Client) : Service(client) { "name" to name, "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -333,8 +276,6 @@ class Health(client: Client) : Service(client) { } /** - * Get deletes queue - * * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -350,8 +291,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -367,9 +307,8 @@ class Health(client: Client) : Service(client) { } /** - * Get number of failed queue jobs - * * Returns the amount of failed jobs in a given queue. + * * * @param name The name of the queue * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -387,8 +326,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -404,8 +342,6 @@ class Health(client: Client) : Service(client) { } /** - * Get functions queue - * * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -421,8 +357,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -438,8 +373,6 @@ class Health(client: Client) : Service(client) { } /** - * Get logs queue - * * Get the number of logs that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -455,8 +388,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -472,8 +404,6 @@ class Health(client: Client) : Service(client) { } /** - * Get mails queue - * * Get the number of mails that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -489,8 +419,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -506,8 +435,6 @@ class Health(client: Client) : Service(client) { } /** - * Get messaging queue - * * Get the number of messages that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -523,8 +450,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -540,8 +466,6 @@ class Health(client: Client) : Service(client) { } /** - * Get migrations queue - * * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -557,8 +481,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -574,25 +497,22 @@ class Health(client: Client) : Service(client) { } /** - * Get usage queue - * - * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. + * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @return [io.appwrite.models.HealthQueue] */ @JvmOverloads @Throws(AppwriteException::class) - suspend fun getQueueUsage( + suspend fun getQueueStatsResources( threshold: Long? = null, ): io.appwrite.models.HealthQueue { - val apiPath = "/health/queue/usage" + val apiPath = "/health/queue/stats-resources" val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -608,25 +528,22 @@ class Health(client: Client) : Service(client) { } /** - * Get usage dump queue - * - * Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server. + * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @return [io.appwrite.models.HealthQueue] */ @JvmOverloads @Throws(AppwriteException::class) - suspend fun getQueueUsageDump( + suspend fun getQueueUsage( threshold: Long? = null, ): io.appwrite.models.HealthQueue { - val apiPath = "/health/queue/usage-dump" + val apiPath = "/health/queue/stats-usage" val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -642,8 +559,6 @@ class Health(client: Client) : Service(client) { } /** - * Get webhooks queue - * * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. * * @param threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -659,8 +574,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( "threshold" to threshold, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthQueue = { io.appwrite.models.HealthQueue.from(map = it as Map) @@ -676,8 +590,6 @@ class Health(client: Client) : Service(client) { } /** - * Get storage - * * Check the Appwrite storage device is up and connection is successful. * * @return [io.appwrite.models.HealthStatus] @@ -689,8 +601,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthStatus = { io.appwrite.models.HealthStatus.from(map = it as Map) @@ -706,8 +617,6 @@ class Health(client: Client) : Service(client) { } /** - * Get local storage - * * Check the Appwrite local storage device is up and connection is successful. * * @return [io.appwrite.models.HealthStatus] @@ -719,8 +628,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthStatus = { io.appwrite.models.HealthStatus.from(map = it as Map) @@ -736,8 +644,6 @@ class Health(client: Client) : Service(client) { } /** - * Get time - * * Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP. * * @return [io.appwrite.models.HealthTime] @@ -749,8 +655,7 @@ class Health(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.HealthTime = { io.appwrite.models.HealthTime.from(map = it as Map) diff --git a/src/main/kotlin/io/appwrite/services/Locale.kt b/src/main/kotlin/io/appwrite/services/Locale.kt index 170fd8b..7d7dbfc 100644 --- a/src/main/kotlin/io/appwrite/services/Locale.kt +++ b/src/main/kotlin/io/appwrite/services/Locale.kt @@ -9,14 +9,14 @@ import okhttp3.Cookie import java.io.File /** - * The Locale service allows you to customize your app based on your users' location. + * The Locale service allows you to customize your app based on your users' location. **/ class Locale(client: Client) : Service(client) { /** - * Get user locale - * - * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.([IP Geolocation by DB-IP](https://db-ip.com)) + * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language. + * + * ([IP Geolocation by DB-IP](https://db-ip.com)) * * @return [io.appwrite.models.Locale] */ @@ -27,8 +27,7 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Locale = { io.appwrite.models.Locale.from(map = it as Map) @@ -44,8 +43,6 @@ class Locale(client: Client) : Service(client) { } /** - * List locale codes - * * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). * * @return [io.appwrite.models.LocaleCodeList] @@ -57,8 +54,7 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.LocaleCodeList = { io.appwrite.models.LocaleCodeList.from(map = it as Map) @@ -74,8 +70,6 @@ class Locale(client: Client) : Service(client) { } /** - * List continents - * * List of all continents. You can use the locale header to get the data in a supported language. * * @return [io.appwrite.models.ContinentList] @@ -87,8 +81,7 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.ContinentList = { io.appwrite.models.ContinentList.from(map = it as Map) @@ -104,8 +97,6 @@ class Locale(client: Client) : Service(client) { } /** - * List countries - * * List of all countries. You can use the locale header to get the data in a supported language. * * @return [io.appwrite.models.CountryList] @@ -117,8 +108,7 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.CountryList = { io.appwrite.models.CountryList.from(map = it as Map) @@ -134,8 +124,6 @@ class Locale(client: Client) : Service(client) { } /** - * List EU countries - * * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language. * * @return [io.appwrite.models.CountryList] @@ -147,8 +135,7 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.CountryList = { io.appwrite.models.CountryList.from(map = it as Map) @@ -164,8 +151,6 @@ class Locale(client: Client) : Service(client) { } /** - * List countries phone codes - * * List of all countries phone codes. You can use the locale header to get the data in a supported language. * * @return [io.appwrite.models.PhoneList] @@ -177,8 +162,7 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.PhoneList = { io.appwrite.models.PhoneList.from(map = it as Map) @@ -194,8 +178,6 @@ class Locale(client: Client) : Service(client) { } /** - * List currencies - * * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language. * * @return [io.appwrite.models.CurrencyList] @@ -207,8 +189,7 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.CurrencyList = { io.appwrite.models.CurrencyList.from(map = it as Map) @@ -224,8 +205,6 @@ class Locale(client: Client) : Service(client) { } /** - * List languages - * * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. * * @return [io.appwrite.models.LanguageList] @@ -237,8 +216,7 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.LanguageList = { io.appwrite.models.LanguageList.from(map = it as Map) diff --git a/src/main/kotlin/io/appwrite/services/Messaging.kt b/src/main/kotlin/io/appwrite/services/Messaging.kt index be6c259..7da5fca 100644 --- a/src/main/kotlin/io/appwrite/services/Messaging.kt +++ b/src/main/kotlin/io/appwrite/services/Messaging.kt @@ -14,8 +14,6 @@ import java.io.File class Messaging(client: Client) : Service(client) { /** - * List messages - * * Get a list of all messages from the current Appwrite project. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType @@ -34,8 +32,7 @@ class Messaging(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.MessageList = { io.appwrite.models.MessageList.from(map = it as Map) @@ -51,8 +48,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create email - * * Create a new email message. * * @param messageId Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -101,7 +96,7 @@ class Messaging(client: Client) : Service(client) { "html" to html, "scheduledAt" to scheduledAt, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Message = { @@ -118,9 +113,8 @@ class Messaging(client: Client) : Service(client) { } /** - * Update email - * - * Update an email message by its unique ID. + * Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + * * * @param messageId Message ID. * @param topics List of Topic IDs. @@ -168,7 +162,7 @@ class Messaging(client: Client) : Service(client) { "scheduledAt" to scheduledAt, "attachments" to attachments, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Message = { @@ -185,8 +179,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create push notification - * * Create a new push notification. * * @param messageId Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -256,7 +248,7 @@ class Messaging(client: Client) : Service(client) { "critical" to critical, "priority" to priority, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Message = { @@ -273,9 +265,8 @@ class Messaging(client: Client) : Service(client) { } /** - * Update push notification - * - * Update a push notification by its unique ID. + * Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + * * * @param messageId Message ID. * @param topics List of Topic IDs. @@ -344,7 +335,7 @@ class Messaging(client: Client) : Service(client) { "critical" to critical, "priority" to priority, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Message = { @@ -361,8 +352,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create SMS - * * Create a new SMS message. * * @param messageId Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -374,6 +363,10 @@ class Messaging(client: Client) : Service(client) { * @param scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @return [io.appwrite.models.Message] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Messaging.createSMS` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Messaging.createSMS") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createSms( @@ -396,7 +389,7 @@ class Messaging(client: Client) : Service(client) { "draft" to draft, "scheduledAt" to scheduledAt, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Message = { @@ -413,9 +406,58 @@ class Messaging(client: Client) : Service(client) { } /** - * Update SMS + * Create a new SMS message. * - * Update an email message by its unique ID. + * @param messageId Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param content SMS Content. + * @param topics List of Topic IDs. + * @param users List of User IDs. + * @param targets List of Targets IDs. + * @param draft Is message a draft + * @param scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + * @return [io.appwrite.models.Message] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createSMS( + messageId: String, + content: String, + topics: List? = null, + users: List? = null, + targets: List? = null, + draft: Boolean? = null, + scheduledAt: String? = null, + ): io.appwrite.models.Message { + val apiPath = "/messaging/messages/sms" + + val apiParams = mutableMapOf( + "messageId" to messageId, + "content" to content, + "topics" to topics, + "users" to users, + "targets" to targets, + "draft" to draft, + "scheduledAt" to scheduledAt, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Message = { + io.appwrite.models.Message.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Message::class.java, + converter, + ) + } + + /** + * Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + * * * @param messageId Message ID. * @param topics List of Topic IDs. @@ -426,6 +468,10 @@ class Messaging(client: Client) : Service(client) { * @param scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @return [io.appwrite.models.Message] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Messaging.updateSMS` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Messaging.updateSMS") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateSms( @@ -448,7 +494,7 @@ class Messaging(client: Client) : Service(client) { "draft" to draft, "scheduledAt" to scheduledAt, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Message = { @@ -465,9 +511,59 @@ class Messaging(client: Client) : Service(client) { } /** - * Get message + * Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. + * * + * @param messageId Message ID. + * @param topics List of Topic IDs. + * @param users List of User IDs. + * @param targets List of Targets IDs. + * @param content Email Content. + * @param draft Is message a draft + * @param scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + * @return [io.appwrite.models.Message] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateSMS( + messageId: String, + topics: List? = null, + users: List? = null, + targets: List? = null, + content: String? = null, + draft: Boolean? = null, + scheduledAt: String? = null, + ): io.appwrite.models.Message { + val apiPath = "/messaging/messages/sms/{messageId}" + .replace("{messageId}", messageId) + + val apiParams = mutableMapOf( + "topics" to topics, + "users" to users, + "targets" to targets, + "content" to content, + "draft" to draft, + "scheduledAt" to scheduledAt, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Message = { + io.appwrite.models.Message.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Message::class.java, + converter, + ) + } + + /** * Get a message by its unique ID. + * * * @param messageId Message ID. * @return [io.appwrite.models.Message] @@ -481,8 +577,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Message = { io.appwrite.models.Message.from(map = it as Map) @@ -498,8 +593,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Delete message - * * Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message. * * @param messageId Message ID. @@ -514,7 +607,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -527,8 +620,6 @@ class Messaging(client: Client) : Service(client) { } /** - * List message logs - * * Get the message activity logs listed by its unique ID. * * @param messageId Message ID. @@ -547,8 +638,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.LogList = { io.appwrite.models.LogList.from(map = it as Map) @@ -564,8 +654,6 @@ class Messaging(client: Client) : Service(client) { } /** - * List message targets - * * Get a list of the targets associated with a message. * * @param messageId Message ID. @@ -584,8 +672,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.TargetList = { io.appwrite.models.TargetList.from(map = it as Map) @@ -601,8 +688,6 @@ class Messaging(client: Client) : Service(client) { } /** - * List providers - * * Get a list of all providers from the current Appwrite project. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled @@ -621,8 +706,7 @@ class Messaging(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.ProviderList = { io.appwrite.models.ProviderList.from(map = it as Map) @@ -638,8 +722,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create APNS provider - * * Create a new Apple Push Notification service provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -652,6 +734,10 @@ class Messaging(client: Client) : Service(client) { * @param enabled Set as enabled. * @return [io.appwrite.models.Provider] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Messaging.createAPNSProvider` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Messaging.createAPNSProvider") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createApnsProvider( @@ -676,7 +762,7 @@ class Messaging(client: Client) : Service(client) { "sandbox" to sandbox, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -693,8 +779,59 @@ class Messaging(client: Client) : Service(client) { } /** - * Update APNS provider + * Create a new Apple Push Notification service provider. * + * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Provider name. + * @param authKey APNS authentication key. + * @param authKeyId APNS authentication key ID. + * @param teamId APNS team ID. + * @param bundleId APNS bundle ID. + * @param sandbox Use APNS sandbox environment. + * @param enabled Set as enabled. + * @return [io.appwrite.models.Provider] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createAPNSProvider( + providerId: String, + name: String, + authKey: String? = null, + authKeyId: String? = null, + teamId: String? = null, + bundleId: String? = null, + sandbox: Boolean? = null, + enabled: Boolean? = null, + ): io.appwrite.models.Provider { + val apiPath = "/messaging/providers/apns" + + val apiParams = mutableMapOf( + "providerId" to providerId, + "name" to name, + "authKey" to authKey, + "authKeyId" to authKeyId, + "teamId" to teamId, + "bundleId" to bundleId, + "sandbox" to sandbox, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Provider = { + io.appwrite.models.Provider.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Provider::class.java, + converter, + ) + } + + /** * Update a Apple Push Notification service provider by its unique ID. * * @param providerId Provider ID. @@ -707,6 +844,10 @@ class Messaging(client: Client) : Service(client) { * @param sandbox Use APNS sandbox environment. * @return [io.appwrite.models.Provider] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Messaging.updateAPNSProvider` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Messaging.updateAPNSProvider") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateApnsProvider( @@ -731,7 +872,7 @@ class Messaging(client: Client) : Service(client) { "bundleId" to bundleId, "sandbox" to sandbox, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -748,8 +889,59 @@ class Messaging(client: Client) : Service(client) { } /** - * Create FCM provider + * Update a Apple Push Notification service provider by its unique ID. * + * @param providerId Provider ID. + * @param name Provider name. + * @param enabled Set as enabled. + * @param authKey APNS authentication key. + * @param authKeyId APNS authentication key ID. + * @param teamId APNS team ID. + * @param bundleId APNS bundle ID. + * @param sandbox Use APNS sandbox environment. + * @return [io.appwrite.models.Provider] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateAPNSProvider( + providerId: String, + name: String? = null, + enabled: Boolean? = null, + authKey: String? = null, + authKeyId: String? = null, + teamId: String? = null, + bundleId: String? = null, + sandbox: Boolean? = null, + ): io.appwrite.models.Provider { + val apiPath = "/messaging/providers/apns/{providerId}" + .replace("{providerId}", providerId) + + val apiParams = mutableMapOf( + "name" to name, + "enabled" to enabled, + "authKey" to authKey, + "authKeyId" to authKeyId, + "teamId" to teamId, + "bundleId" to bundleId, + "sandbox" to sandbox, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Provider = { + io.appwrite.models.Provider.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Provider::class.java, + converter, + ) + } + + /** * Create a new Firebase Cloud Messaging provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -758,6 +950,10 @@ class Messaging(client: Client) : Service(client) { * @param enabled Set as enabled. * @return [io.appwrite.models.Provider] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Messaging.createFCMProvider` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Messaging.createFCMProvider") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createFcmProvider( @@ -774,7 +970,7 @@ class Messaging(client: Client) : Service(client) { "serviceAccountJSON" to serviceAccountJSON, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -791,8 +987,47 @@ class Messaging(client: Client) : Service(client) { } /** - * Update FCM provider + * Create a new Firebase Cloud Messaging provider. * + * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Provider name. + * @param serviceAccountJSON FCM service account JSON. + * @param enabled Set as enabled. + * @return [io.appwrite.models.Provider] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createFCMProvider( + providerId: String, + name: String, + serviceAccountJSON: Any? = null, + enabled: Boolean? = null, + ): io.appwrite.models.Provider { + val apiPath = "/messaging/providers/fcm" + + val apiParams = mutableMapOf( + "providerId" to providerId, + "name" to name, + "serviceAccountJSON" to serviceAccountJSON, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Provider = { + io.appwrite.models.Provider.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Provider::class.java, + converter, + ) + } + + /** * Update a Firebase Cloud Messaging provider by its unique ID. * * @param providerId Provider ID. @@ -801,6 +1036,10 @@ class Messaging(client: Client) : Service(client) { * @param serviceAccountJSON FCM service account JSON. * @return [io.appwrite.models.Provider] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Messaging.updateFCMProvider` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Messaging.updateFCMProvider") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateFcmProvider( @@ -817,7 +1056,7 @@ class Messaging(client: Client) : Service(client) { "enabled" to enabled, "serviceAccountJSON" to serviceAccountJSON, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -834,8 +1073,47 @@ class Messaging(client: Client) : Service(client) { } /** - * Create Mailgun provider + * Update a Firebase Cloud Messaging provider by its unique ID. * + * @param providerId Provider ID. + * @param name Provider name. + * @param enabled Set as enabled. + * @param serviceAccountJSON FCM service account JSON. + * @return [io.appwrite.models.Provider] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateFCMProvider( + providerId: String, + name: String? = null, + enabled: Boolean? = null, + serviceAccountJSON: Any? = null, + ): io.appwrite.models.Provider { + val apiPath = "/messaging/providers/fcm/{providerId}" + .replace("{providerId}", providerId) + + val apiParams = mutableMapOf( + "name" to name, + "enabled" to enabled, + "serviceAccountJSON" to serviceAccountJSON, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Provider = { + io.appwrite.models.Provider.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Provider::class.java, + converter, + ) + } + + /** * Create a new Mailgun provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -878,7 +1156,7 @@ class Messaging(client: Client) : Service(client) { "replyToEmail" to replyToEmail, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -895,8 +1173,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Update Mailgun provider - * * Update a Mailgun provider by its unique ID. * * @param providerId Provider ID. @@ -939,7 +1215,7 @@ class Messaging(client: Client) : Service(client) { "replyToName" to replyToName, "replyToEmail" to replyToEmail, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -956,8 +1232,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create Msg91 provider - * * Create a new MSG91 provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -988,7 +1262,7 @@ class Messaging(client: Client) : Service(client) { "authKey" to authKey, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1005,8 +1279,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Update Msg91 provider - * * Update a MSG91 provider by its unique ID. * * @param providerId Provider ID. @@ -1037,7 +1309,7 @@ class Messaging(client: Client) : Service(client) { "senderId" to senderId, "authKey" to authKey, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1054,8 +1326,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create Sendgrid provider - * * Create a new Sendgrid provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1092,7 +1362,7 @@ class Messaging(client: Client) : Service(client) { "replyToEmail" to replyToEmail, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1109,8 +1379,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Update Sendgrid provider - * * Update a Sendgrid provider by its unique ID. * * @param providerId Provider ID. @@ -1147,7 +1415,7 @@ class Messaging(client: Client) : Service(client) { "replyToName" to replyToName, "replyToEmail" to replyToEmail, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1164,8 +1432,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create SMTP provider - * * Create a new SMTP provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1184,6 +1450,10 @@ class Messaging(client: Client) : Service(client) { * @param enabled Set as enabled. * @return [io.appwrite.models.Provider] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Messaging.createSMTPProvider` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Messaging.createSMTPProvider") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun createSmtpProvider( @@ -1220,7 +1490,7 @@ class Messaging(client: Client) : Service(client) { "replyToEmail" to replyToEmail, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1237,8 +1507,77 @@ class Messaging(client: Client) : Service(client) { } /** - * Update SMTP provider + * Create a new SMTP provider. * + * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Provider name. + * @param host SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. + * @param port The default SMTP server port. + * @param username Authentication username. + * @param password Authentication password. + * @param encryption Encryption type. Can be omitted, 'ssl', or 'tls' + * @param autoTLS Enable SMTP AutoTLS feature. + * @param mailer The value to use for the X-Mailer header. + * @param fromName Sender Name. + * @param fromEmail Sender email address. + * @param replyToName Name set in the reply to field for the mail. Default value is sender name. + * @param replyToEmail Email set in the reply to field for the mail. Default value is sender email. + * @param enabled Set as enabled. + * @return [io.appwrite.models.Provider] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createSMTPProvider( + providerId: String, + name: String, + host: String, + port: Long? = null, + username: String? = null, + password: String? = null, + encryption: io.appwrite.enums.SmtpEncryption? = null, + autoTLS: Boolean? = null, + mailer: String? = null, + fromName: String? = null, + fromEmail: String? = null, + replyToName: String? = null, + replyToEmail: String? = null, + enabled: Boolean? = null, + ): io.appwrite.models.Provider { + val apiPath = "/messaging/providers/smtp" + + val apiParams = mutableMapOf( + "providerId" to providerId, + "name" to name, + "host" to host, + "port" to port, + "username" to username, + "password" to password, + "encryption" to encryption, + "autoTLS" to autoTLS, + "mailer" to mailer, + "fromName" to fromName, + "fromEmail" to fromEmail, + "replyToName" to replyToName, + "replyToEmail" to replyToEmail, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Provider = { + io.appwrite.models.Provider.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Provider::class.java, + converter, + ) + } + + /** * Update a SMTP provider by its unique ID. * * @param providerId Provider ID. @@ -1257,6 +1596,10 @@ class Messaging(client: Client) : Service(client) { * @param enabled Set as enabled. * @return [io.appwrite.models.Provider] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Messaging.updateSMTPProvider") + ) @JvmOverloads @Throws(AppwriteException::class) suspend fun updateSmtpProvider( @@ -1293,7 +1636,7 @@ class Messaging(client: Client) : Service(client) { "replyToEmail" to replyToEmail, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1310,8 +1653,77 @@ class Messaging(client: Client) : Service(client) { } /** - * Create Telesign provider + * Update a SMTP provider by its unique ID. * + * @param providerId Provider ID. + * @param name Provider name. + * @param host SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. + * @param port SMTP port. + * @param username Authentication username. + * @param password Authentication password. + * @param encryption Encryption type. Can be 'ssl' or 'tls' + * @param autoTLS Enable SMTP AutoTLS feature. + * @param mailer The value to use for the X-Mailer header. + * @param fromName Sender Name. + * @param fromEmail Sender email address. + * @param replyToName Name set in the Reply To field for the mail. Default value is Sender Name. + * @param replyToEmail Email set in the Reply To field for the mail. Default value is Sender Email. + * @param enabled Set as enabled. + * @return [io.appwrite.models.Provider] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateSMTPProvider( + providerId: String, + name: String? = null, + host: String? = null, + port: Long? = null, + username: String? = null, + password: String? = null, + encryption: io.appwrite.enums.SmtpEncryption? = null, + autoTLS: Boolean? = null, + mailer: String? = null, + fromName: String? = null, + fromEmail: String? = null, + replyToName: String? = null, + replyToEmail: String? = null, + enabled: Boolean? = null, + ): io.appwrite.models.Provider { + val apiPath = "/messaging/providers/smtp/{providerId}" + .replace("{providerId}", providerId) + + val apiParams = mutableMapOf( + "name" to name, + "host" to host, + "port" to port, + "username" to username, + "password" to password, + "encryption" to encryption, + "autoTLS" to autoTLS, + "mailer" to mailer, + "fromName" to fromName, + "fromEmail" to fromEmail, + "replyToName" to replyToName, + "replyToEmail" to replyToEmail, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Provider = { + io.appwrite.models.Provider.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Provider::class.java, + converter, + ) + } + + /** * Create a new Telesign provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1342,7 +1754,7 @@ class Messaging(client: Client) : Service(client) { "apiKey" to apiKey, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1359,8 +1771,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Update Telesign provider - * * Update a Telesign provider by its unique ID. * * @param providerId Provider ID. @@ -1391,7 +1801,7 @@ class Messaging(client: Client) : Service(client) { "apiKey" to apiKey, "from" to from, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1408,8 +1818,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create Textmagic provider - * * Create a new Textmagic provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1440,7 +1848,7 @@ class Messaging(client: Client) : Service(client) { "apiKey" to apiKey, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1457,8 +1865,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Update Textmagic provider - * * Update a Textmagic provider by its unique ID. * * @param providerId Provider ID. @@ -1489,7 +1895,7 @@ class Messaging(client: Client) : Service(client) { "apiKey" to apiKey, "from" to from, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1506,8 +1912,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create Twilio provider - * * Create a new Twilio provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1538,7 +1942,7 @@ class Messaging(client: Client) : Service(client) { "authToken" to authToken, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1555,8 +1959,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Update Twilio provider - * * Update a Twilio provider by its unique ID. * * @param providerId Provider ID. @@ -1587,7 +1989,7 @@ class Messaging(client: Client) : Service(client) { "authToken" to authToken, "from" to from, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1604,8 +2006,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create Vonage provider - * * Create a new Vonage provider. * * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1636,7 +2036,7 @@ class Messaging(client: Client) : Service(client) { "apiSecret" to apiSecret, "enabled" to enabled, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1653,8 +2053,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Update Vonage provider - * * Update a Vonage provider by its unique ID. * * @param providerId Provider ID. @@ -1685,7 +2083,7 @@ class Messaging(client: Client) : Service(client) { "apiSecret" to apiSecret, "from" to from, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Provider = { @@ -1702,9 +2100,8 @@ class Messaging(client: Client) : Service(client) { } /** - * Get provider - * * Get a provider by its unique ID. + * * * @param providerId Provider ID. * @return [io.appwrite.models.Provider] @@ -1718,8 +2115,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Provider = { io.appwrite.models.Provider.from(map = it as Map) @@ -1735,8 +2131,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Delete provider - * * Delete a provider by its unique ID. * * @param providerId Provider ID. @@ -1751,7 +2145,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -1764,8 +2158,6 @@ class Messaging(client: Client) : Service(client) { } /** - * List provider logs - * * Get the provider activity logs listed by its unique ID. * * @param providerId Provider ID. @@ -1784,8 +2176,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.LogList = { io.appwrite.models.LogList.from(map = it as Map) @@ -1801,8 +2192,6 @@ class Messaging(client: Client) : Service(client) { } /** - * List subscriber logs - * * Get the subscriber activity logs listed by its unique ID. * * @param subscriberId Subscriber ID. @@ -1821,8 +2210,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.LogList = { io.appwrite.models.LogList.from(map = it as Map) @@ -1838,8 +2226,6 @@ class Messaging(client: Client) : Service(client) { } /** - * List topics - * * Get a list of all topics from the current Appwrite project. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal @@ -1858,8 +2244,7 @@ class Messaging(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.TopicList = { io.appwrite.models.TopicList.from(map = it as Map) @@ -1875,8 +2260,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create topic - * * Create a new topic. * * @param topicId Topic ID. Choose a custom Topic ID or a new Topic ID. @@ -1898,7 +2281,7 @@ class Messaging(client: Client) : Service(client) { "name" to name, "subscribe" to subscribe, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Topic = { @@ -1915,9 +2298,8 @@ class Messaging(client: Client) : Service(client) { } /** - * Get topic - * * Get a topic by its unique ID. + * * * @param topicId Topic ID. * @return [io.appwrite.models.Topic] @@ -1931,8 +2313,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Topic = { io.appwrite.models.Topic.from(map = it as Map) @@ -1948,9 +2329,8 @@ class Messaging(client: Client) : Service(client) { } /** - * Update topic - * * Update a topic by its unique ID. + * * * @param topicId Topic ID. * @param name Topic Name. @@ -1971,7 +2351,7 @@ class Messaging(client: Client) : Service(client) { "name" to name, "subscribe" to subscribe, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Topic = { @@ -1988,8 +2368,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Delete topic - * * Delete a topic by its unique ID. * * @param topicId Topic ID. @@ -2004,7 +2382,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -2017,8 +2395,6 @@ class Messaging(client: Client) : Service(client) { } /** - * List topic logs - * * Get the topic activity logs listed by its unique ID. * * @param topicId Topic ID. @@ -2037,8 +2413,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.LogList = { io.appwrite.models.LogList.from(map = it as Map) @@ -2054,8 +2429,6 @@ class Messaging(client: Client) : Service(client) { } /** - * List subscribers - * * Get a list of all subscribers from the current Appwrite project. * * @param topicId Topic ID. The topic ID subscribed to. @@ -2077,8 +2450,7 @@ class Messaging(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.SubscriberList = { io.appwrite.models.SubscriberList.from(map = it as Map) @@ -2094,8 +2466,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Create subscriber - * * Create a new subscriber. * * @param topicId Topic ID. The topic ID to subscribe to. @@ -2116,7 +2486,7 @@ class Messaging(client: Client) : Service(client) { "subscriberId" to subscriberId, "targetId" to targetId, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Subscriber = { @@ -2133,9 +2503,8 @@ class Messaging(client: Client) : Service(client) { } /** - * Get subscriber - * * Get a subscriber by its unique ID. + * * * @param topicId Topic ID. The topic ID subscribed to. * @param subscriberId Subscriber ID. @@ -2152,8 +2521,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Subscriber = { io.appwrite.models.Subscriber.from(map = it as Map) @@ -2169,8 +2537,6 @@ class Messaging(client: Client) : Service(client) { } /** - * Delete subscriber - * * Delete a subscriber by its unique ID. * * @param topicId Topic ID. The topic ID subscribed to. @@ -2188,7 +2554,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( diff --git a/src/main/kotlin/io/appwrite/services/Sites.kt b/src/main/kotlin/io/appwrite/services/Sites.kt new file mode 100644 index 0000000..171a6d9 --- /dev/null +++ b/src/main/kotlin/io/appwrite/services/Sites.kt @@ -0,0 +1,982 @@ +package io.appwrite.services + +import io.appwrite.Client +import io.appwrite.models.* +import io.appwrite.enums.* +import io.appwrite.exceptions.AppwriteException +import io.appwrite.extensions.classOf +import okhttp3.Cookie +import okhttp3.HttpUrl +import okhttp3.HttpUrl.Companion.toHttpUrl +import java.io.File + +/** + * The Sites Service allows you view, create and manage your web applications. +**/ +class Sites(client: Client) : Service(client) { + + /** + * Get a list of all the project's sites. You can use the query params to filter your results. + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId + * @param search Search term to filter your list results. Max length: 256 chars. + * @return [io.appwrite.models.SiteList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun list( + queries: List? = null, + search: String? = null, + ): io.appwrite.models.SiteList { + val apiPath = "/sites" + + val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.SiteList = { + io.appwrite.models.SiteList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.SiteList::class.java, + converter, + ) + } + + /** + * Create a new site. + * + * @param siteId Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Site name. Max length: 128 chars. + * @param framework Sites framework. + * @param buildRuntime Runtime to use during build step. + * @param enabled Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. + * @param logging When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + * @param timeout Maximum request time in seconds. + * @param installCommand Install Command. + * @param buildCommand Build Command. + * @param outputDirectory Output Directory for site. + * @param adapter Framework adapter defining rendering strategy. Allowed values are: static, ssr + * @param installationId Appwrite Installation ID for VCS (Version Control System) deployment. + * @param fallbackFile Fallback file for single page application sites. + * @param providerRepositoryId Repository ID of the repo linked to the site. + * @param providerBranch Production branch for the repo linked to the site. + * @param providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. + * @param providerRootDirectory Path to site code in the linked repo. + * @param specification Framework specification for the site and builds. + * @return [io.appwrite.models.Site] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun create( + siteId: String, + name: String, + framework: io.appwrite.enums.Framework, + buildRuntime: io.appwrite.enums.BuildRuntime, + enabled: Boolean? = null, + logging: Boolean? = null, + timeout: Long? = null, + installCommand: String? = null, + buildCommand: String? = null, + outputDirectory: String? = null, + adapter: io.appwrite.enums.Adapter? = null, + installationId: String? = null, + fallbackFile: String? = null, + providerRepositoryId: String? = null, + providerBranch: String? = null, + providerSilentMode: Boolean? = null, + providerRootDirectory: String? = null, + specification: String? = null, + ): io.appwrite.models.Site { + val apiPath = "/sites" + + val apiParams = mutableMapOf( + "siteId" to siteId, + "name" to name, + "framework" to framework, + "enabled" to enabled, + "logging" to logging, + "timeout" to timeout, + "installCommand" to installCommand, + "buildCommand" to buildCommand, + "outputDirectory" to outputDirectory, + "buildRuntime" to buildRuntime, + "adapter" to adapter, + "installationId" to installationId, + "fallbackFile" to fallbackFile, + "providerRepositoryId" to providerRepositoryId, + "providerBranch" to providerBranch, + "providerSilentMode" to providerSilentMode, + "providerRootDirectory" to providerRootDirectory, + "specification" to specification, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Site = { + io.appwrite.models.Site.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Site::class.java, + converter, + ) + } + + /** + * Get a list of all frameworks that are currently available on the server instance. + * + * @return [io.appwrite.models.FrameworkList] + */ + @Throws(AppwriteException::class) + suspend fun listFrameworks( + ): io.appwrite.models.FrameworkList { + val apiPath = "/sites/frameworks" + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.FrameworkList = { + io.appwrite.models.FrameworkList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.FrameworkList::class.java, + converter, + ) + } + + /** + * List allowed site specifications for this instance. + * + * @return [io.appwrite.models.SpecificationList] + */ + @Throws(AppwriteException::class) + suspend fun listSpecifications( + ): io.appwrite.models.SpecificationList { + val apiPath = "/sites/specifications" + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.SpecificationList = { + io.appwrite.models.SpecificationList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.SpecificationList::class.java, + converter, + ) + } + + /** + * Get a site by its unique ID. + * + * @param siteId Site ID. + * @return [io.appwrite.models.Site] + */ + @Throws(AppwriteException::class) + suspend fun get( + siteId: String, + ): io.appwrite.models.Site { + val apiPath = "/sites/{siteId}" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Site = { + io.appwrite.models.Site.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Site::class.java, + converter, + ) + } + + /** + * Update site by its unique ID. + * + * @param siteId Site ID. + * @param name Site name. Max length: 128 chars. + * @param framework Sites framework. + * @param enabled Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. + * @param logging When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + * @param timeout Maximum request time in seconds. + * @param installCommand Install Command. + * @param buildCommand Build Command. + * @param outputDirectory Output Directory for site. + * @param buildRuntime Runtime to use during build step. + * @param adapter Framework adapter defining rendering strategy. Allowed values are: static, ssr + * @param fallbackFile Fallback file for single page application sites. + * @param installationId Appwrite Installation ID for VCS (Version Control System) deployment. + * @param providerRepositoryId Repository ID of the repo linked to the site. + * @param providerBranch Production branch for the repo linked to the site. + * @param providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. + * @param providerRootDirectory Path to site code in the linked repo. + * @param specification Framework specification for the site and builds. + * @return [io.appwrite.models.Site] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun update( + siteId: String, + name: String, + framework: io.appwrite.enums.Framework, + enabled: Boolean? = null, + logging: Boolean? = null, + timeout: Long? = null, + installCommand: String? = null, + buildCommand: String? = null, + outputDirectory: String? = null, + buildRuntime: io.appwrite.enums.BuildRuntime? = null, + adapter: io.appwrite.enums.Adapter? = null, + fallbackFile: String? = null, + installationId: String? = null, + providerRepositoryId: String? = null, + providerBranch: String? = null, + providerSilentMode: Boolean? = null, + providerRootDirectory: String? = null, + specification: String? = null, + ): io.appwrite.models.Site { + val apiPath = "/sites/{siteId}" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "name" to name, + "framework" to framework, + "enabled" to enabled, + "logging" to logging, + "timeout" to timeout, + "installCommand" to installCommand, + "buildCommand" to buildCommand, + "outputDirectory" to outputDirectory, + "buildRuntime" to buildRuntime, + "adapter" to adapter, + "fallbackFile" to fallbackFile, + "installationId" to installationId, + "providerRepositoryId" to providerRepositoryId, + "providerBranch" to providerBranch, + "providerSilentMode" to providerSilentMode, + "providerRootDirectory" to providerRootDirectory, + "specification" to specification, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Site = { + io.appwrite.models.Site.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Site::class.java, + converter, + ) + } + + /** + * Delete a site by its unique ID. + * + * @param siteId Site ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun delete( + siteId: String, + ): Any { + val apiPath = "/sites/{siteId}" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site. + * + * @param siteId Site ID. + * @param deploymentId Deployment ID. + * @return [io.appwrite.models.Site] + */ + @Throws(AppwriteException::class) + suspend fun updateSiteDeployment( + siteId: String, + deploymentId: String, + ): io.appwrite.models.Site { + val apiPath = "/sites/{siteId}/deployment" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "deploymentId" to deploymentId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Site = { + io.appwrite.models.Site.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Site::class.java, + converter, + ) + } + + /** + * Get a list of all the site's code deployments. You can use the query params to filter your results. + * + * @param siteId Site ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type + * @param search Search term to filter your list results. Max length: 256 chars. + * @return [io.appwrite.models.DeploymentList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listDeployments( + siteId: String, + queries: List? = null, + search: String? = null, + ): io.appwrite.models.DeploymentList { + val apiPath = "/sites/{siteId}/deployments" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.DeploymentList = { + io.appwrite.models.DeploymentList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.DeploymentList::class.java, + converter, + ) + } + + /** + * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID. + * + * @param siteId Site ID. + * @param code Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. + * @param activate Automatically activate the deployment when it is finished building. + * @param installCommand Install Commands. + * @param buildCommand Build Commands. + * @param outputDirectory Output Directory. + * @return [io.appwrite.models.Deployment] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createDeployment( + siteId: String, + code: InputFile, + activate: Boolean, + installCommand: String? = null, + buildCommand: String? = null, + outputDirectory: String? = null, + onProgress: ((UploadProgress) -> Unit)? = null + ): io.appwrite.models.Deployment { + val apiPath = "/sites/{siteId}/deployments" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "installCommand" to installCommand, + "buildCommand" to buildCommand, + "outputDirectory" to outputDirectory, + "code" to code, + "activate" to activate, + ) + val apiHeaders = mutableMapOf( + "content-type" to "multipart/form-data", + ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } + val idParamName: String? = null + val paramName = "code" + return client.chunkedUpload( + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Deployment::class.java, + converter, + paramName, + idParamName, + onProgress, + ) + } + + /** + * Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + * + * @param siteId Site ID. + * @param deploymentId Deployment ID. + * @return [io.appwrite.models.Deployment] + */ + @Throws(AppwriteException::class) + suspend fun createDuplicateDeployment( + siteId: String, + deploymentId: String, + ): io.appwrite.models.Deployment { + val apiPath = "/sites/{siteId}/deployments/duplicate" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "deploymentId" to deploymentId, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Deployment::class.java, + converter, + ) + } + + /** + * Create a deployment based on a template. + * + * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. + * + * @param siteId Site ID. + * @param repository Repository name of the template. + * @param owner The name of the owner of the template. + * @param rootDirectory Path to site code in the template repo. + * @param version Version (tag) for the repo linked to the site template. + * @param activate Automatically activate the deployment when it is finished building. + * @return [io.appwrite.models.Deployment] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createTemplateDeployment( + siteId: String, + repository: String, + owner: String, + rootDirectory: String, + version: String, + activate: Boolean? = null, + ): io.appwrite.models.Deployment { + val apiPath = "/sites/{siteId}/deployments/template" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "repository" to repository, + "owner" to owner, + "rootDirectory" to rootDirectory, + "version" to version, + "activate" to activate, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Deployment::class.java, + converter, + ) + } + + /** + * Create a deployment when a site is connected to VCS. + * + * This endpoint lets you create deployment from a branch, commit, or a tag. + * + * @param siteId Site ID. + * @param type Type of reference passed. Allowed values are: branch, commit + * @param reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash + * @param activate Automatically activate the deployment when it is finished building. + * @return [io.appwrite.models.Deployment] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createVcsDeployment( + siteId: String, + type: io.appwrite.enums.VCSDeploymentType, + reference: String, + activate: Boolean? = null, + ): io.appwrite.models.Deployment { + val apiPath = "/sites/{siteId}/deployments/vcs" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "type" to type, + "reference" to reference, + "activate" to activate, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Deployment::class.java, + converter, + ) + } + + /** + * Get a site deployment by its unique ID. + * + * @param siteId Site ID. + * @param deploymentId Deployment ID. + * @return [io.appwrite.models.Deployment] + */ + @Throws(AppwriteException::class) + suspend fun getDeployment( + siteId: String, + deploymentId: String, + ): io.appwrite.models.Deployment { + val apiPath = "/sites/{siteId}/deployments/{deploymentId}" + .replace("{siteId}", siteId) + .replace("{deploymentId}", deploymentId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Deployment::class.java, + converter, + ) + } + + /** + * Delete a site deployment by its unique ID. + * + * @param siteId Site ID. + * @param deploymentId Deployment ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteDeployment( + siteId: String, + deploymentId: String, + ): Any { + val apiPath = "/sites/{siteId}/deployments/{deploymentId}" + .replace("{siteId}", siteId) + .replace("{deploymentId}", deploymentId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + * + * @param siteId Site ID. + * @param deploymentId Deployment ID. + * @param type Deployment file to download. Can be: "source", "output". + * @return [ByteArray] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getDeploymentDownload( + siteId: String, + deploymentId: String, + type: io.appwrite.enums.DeploymentDownloadType? = null, + ): ByteArray { + val apiPath = "/sites/{siteId}/deployments/{deploymentId}/download" + .replace("{siteId}", siteId) + .replace("{deploymentId}", deploymentId) + + val apiParams = mutableMapOf( + "type" to type, + ) + val apiHeaders = mutableMapOf( + ) + return client.call( + "GET", + apiPath, + params = apiParams, + responseType = ByteArray::class.java + ) + } + + /** + * Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + * + * @param siteId Site ID. + * @param deploymentId Deployment ID. + * @return [io.appwrite.models.Deployment] + */ + @Throws(AppwriteException::class) + suspend fun updateDeploymentStatus( + siteId: String, + deploymentId: String, + ): io.appwrite.models.Deployment { + val apiPath = "/sites/{siteId}/deployments/{deploymentId}/status" + .replace("{siteId}", siteId) + .replace("{deploymentId}", deploymentId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Deployment = { + io.appwrite.models.Deployment.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Deployment::class.java, + converter, + ) + } + + /** + * Get a list of all site logs. You can use the query params to filter your results. + * + * @param siteId Site ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId + * @return [io.appwrite.models.ExecutionList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listLogs( + siteId: String, + queries: List? = null, + ): io.appwrite.models.ExecutionList { + val apiPath = "/sites/{siteId}/logs" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.ExecutionList = { + io.appwrite.models.ExecutionList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ExecutionList::class.java, + converter, + ) + } + + /** + * Get a site request log by its unique ID. + * + * @param siteId Site ID. + * @param logId Log ID. + * @return [io.appwrite.models.Execution] + */ + @Throws(AppwriteException::class) + suspend fun getLog( + siteId: String, + logId: String, + ): io.appwrite.models.Execution { + val apiPath = "/sites/{siteId}/logs/{logId}" + .replace("{siteId}", siteId) + .replace("{logId}", logId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Execution = { + io.appwrite.models.Execution.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Execution::class.java, + converter, + ) + } + + /** + * Delete a site log by its unique ID. + * + * @param siteId Site ID. + * @param logId Log ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteLog( + siteId: String, + logId: String, + ): Any { + val apiPath = "/sites/{siteId}/logs/{logId}" + .replace("{siteId}", siteId) + .replace("{logId}", logId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Get a list of all variables of a specific site. + * + * @param siteId Site unique ID. + * @return [io.appwrite.models.VariableList] + */ + @Throws(AppwriteException::class) + suspend fun listVariables( + siteId: String, + ): io.appwrite.models.VariableList { + val apiPath = "/sites/{siteId}/variables" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.VariableList = { + io.appwrite.models.VariableList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.VariableList::class.java, + converter, + ) + } + + /** + * Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. + * + * @param siteId Site unique ID. + * @param key Variable key. Max length: 255 chars. + * @param value Variable value. Max length: 8192 chars. + * @param secret Secret variables can be updated or deleted, but only sites can read them during build and runtime. + * @return [io.appwrite.models.Variable] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createVariable( + siteId: String, + key: String, + value: String, + secret: Boolean? = null, + ): io.appwrite.models.Variable { + val apiPath = "/sites/{siteId}/variables" + .replace("{siteId}", siteId) + + val apiParams = mutableMapOf( + "key" to key, + "value" to value, + "secret" to secret, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Variable = { + io.appwrite.models.Variable.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Variable::class.java, + converter, + ) + } + + /** + * Get a variable by its unique ID. + * + * @param siteId Site unique ID. + * @param variableId Variable unique ID. + * @return [io.appwrite.models.Variable] + */ + @Throws(AppwriteException::class) + suspend fun getVariable( + siteId: String, + variableId: String, + ): io.appwrite.models.Variable { + val apiPath = "/sites/{siteId}/variables/{variableId}" + .replace("{siteId}", siteId) + .replace("{variableId}", variableId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Variable = { + io.appwrite.models.Variable.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Variable::class.java, + converter, + ) + } + + /** + * Update variable by its unique ID. + * + * @param siteId Site unique ID. + * @param variableId Variable unique ID. + * @param key Variable key. Max length: 255 chars. + * @param value Variable value. Max length: 8192 chars. + * @param secret Secret variables can be updated or deleted, but only sites can read them during build and runtime. + * @return [io.appwrite.models.Variable] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateVariable( + siteId: String, + variableId: String, + key: String, + value: String? = null, + secret: Boolean? = null, + ): io.appwrite.models.Variable { + val apiPath = "/sites/{siteId}/variables/{variableId}" + .replace("{siteId}", siteId) + .replace("{variableId}", variableId) + + val apiParams = mutableMapOf( + "key" to key, + "value" to value, + "secret" to secret, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Variable = { + io.appwrite.models.Variable.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Variable::class.java, + converter, + ) + } + + /** + * Delete a variable by its unique ID. + * + * @param siteId Site unique ID. + * @param variableId Variable unique ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteVariable( + siteId: String, + variableId: String, + ): Any { + val apiPath = "/sites/{siteId}/variables/{variableId}" + .replace("{siteId}", siteId) + .replace("{variableId}", variableId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/Storage.kt b/src/main/kotlin/io/appwrite/services/Storage.kt index 5a10935..c1cad5e 100644 --- a/src/main/kotlin/io/appwrite/services/Storage.kt +++ b/src/main/kotlin/io/appwrite/services/Storage.kt @@ -16,8 +16,6 @@ import java.io.File class Storage(client: Client) : Service(client) { /** - * List buckets - * * Get a list of all the storage buckets. You can use the query params to filter your results. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus @@ -36,8 +34,7 @@ class Storage(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.BucketList = { io.appwrite.models.BucketList.from(map = it as Map) @@ -53,8 +50,6 @@ class Storage(client: Client) : Service(client) { } /** - * Create bucket - * * Create a new storage bucket. * * @param bucketId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -97,7 +92,7 @@ class Storage(client: Client) : Service(client) { "encryption" to encryption, "antivirus" to antivirus, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Bucket = { @@ -114,8 +109,6 @@ class Storage(client: Client) : Service(client) { } /** - * Get bucket - * * Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata. * * @param bucketId Bucket unique ID. @@ -130,8 +123,7 @@ class Storage(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Bucket = { io.appwrite.models.Bucket.from(map = it as Map) @@ -147,8 +139,6 @@ class Storage(client: Client) : Service(client) { } /** - * Update bucket - * * Update a storage bucket by its unique ID. * * @param bucketId Bucket unique ID. @@ -191,7 +181,7 @@ class Storage(client: Client) : Service(client) { "encryption" to encryption, "antivirus" to antivirus, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Bucket = { @@ -208,8 +198,6 @@ class Storage(client: Client) : Service(client) { } /** - * Delete bucket - * * Delete a storage bucket by its unique ID. * * @param bucketId Bucket unique ID. @@ -224,7 +212,7 @@ class Storage(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -237,8 +225,6 @@ class Storage(client: Client) : Service(client) { } /** - * List files - * * Get a list of all the user files. You can use the query params to filter your results. * * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -260,8 +246,7 @@ class Storage(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.FileList = { io.appwrite.models.FileList.from(map = it as Map) @@ -277,9 +262,14 @@ class Storage(client: Client) : Service(client) { } /** - * Create file - * - * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. + * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console. + * + * Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes. + * + * When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. + * + * If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. + * * * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param fileId File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -304,7 +294,7 @@ class Storage(client: Client) : Service(client) { "file" to file, "permissions" to permissions, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "multipart/form-data", ) val converter: (Any) -> io.appwrite.models.File = { @@ -325,8 +315,6 @@ class Storage(client: Client) : Service(client) { } /** - * Get file - * * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. * * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -344,8 +332,7 @@ class Storage(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.File = { io.appwrite.models.File.from(map = it as Map) @@ -361,8 +348,6 @@ class Storage(client: Client) : Service(client) { } /** - * Update file - * * Update a file by its unique ID. Only users with write permissions have access to update this resource. * * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -387,7 +372,7 @@ class Storage(client: Client) : Service(client) { "name" to name, "permissions" to permissions, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.File = { @@ -404,8 +389,6 @@ class Storage(client: Client) : Service(client) { } /** - * Delete file - * * Delete a file by its unique ID. Only users with write permissions have access to delete this resource. * * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -423,7 +406,7 @@ class Storage(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -436,27 +419,28 @@ class Storage(client: Client) : Service(client) { } /** - * Get file for download - * - * Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. + * Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. * * @param bucketId Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param fileId File ID. + * @param token File token for accessing this file. * @return [ByteArray] */ + @JvmOverloads @Throws(AppwriteException::class) suspend fun getFileDownload( bucketId: String, fileId: String, + token: String? = null, ): ByteArray { val apiPath = "/storage/buckets/{bucketId}/files/{fileId}/download" .replace("{bucketId}", bucketId) .replace("{fileId}", fileId) val apiParams = mutableMapOf( + "token" to token, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -467,8 +451,6 @@ class Storage(client: Client) : Service(client) { } /** - * Get file preview - * * Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. * * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -476,7 +458,7 @@ class Storage(client: Client) : Service(client) { * @param width Resize preview image width, Pass an integer between 0 to 4000. * @param height Resize preview image height, Pass an integer between 0 to 4000. * @param gravity Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right - * @param quality Preview image quality. Pass an integer between 0 to 100. Defaults to 100. + * @param quality Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @param borderWidth Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param borderColor Preview image border color. Use a valid HEX color, no # is needed for prefix. * @param borderRadius Preview image border radius in pixels. Pass an integer between 0 to 4000. @@ -484,6 +466,7 @@ class Storage(client: Client) : Service(client) { * @param rotation Preview image rotation in degrees. Pass an integer between -360 and 360. * @param background Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. * @param output Output format type (jpeg, jpg, png, gif and webp). + * @param token File token for accessing this file. * @return [ByteArray] */ @JvmOverloads @@ -502,6 +485,7 @@ class Storage(client: Client) : Service(client) { rotation: Long? = null, background: String? = null, output: io.appwrite.enums.ImageFormat? = null, + token: String? = null, ): ByteArray { val apiPath = "/storage/buckets/{bucketId}/files/{fileId}/preview" .replace("{bucketId}", bucketId) @@ -519,9 +503,9 @@ class Storage(client: Client) : Service(client) { "rotation" to rotation, "background" to background, "output" to output, + "token" to token, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", @@ -532,27 +516,28 @@ class Storage(client: Client) : Service(client) { } /** - * Get file for view - * - * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. + * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. * * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param fileId File ID. + * @param token File token for accessing this file. * @return [ByteArray] */ + @JvmOverloads @Throws(AppwriteException::class) suspend fun getFileView( bucketId: String, fileId: String, + token: String? = null, ): ByteArray { val apiPath = "/storage/buckets/{bucketId}/files/{fileId}/view" .replace("{bucketId}", bucketId) .replace("{fileId}", fileId) val apiParams = mutableMapOf( + "token" to token, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) return client.call( "GET", diff --git a/src/main/kotlin/io/appwrite/services/TablesDb.kt b/src/main/kotlin/io/appwrite/services/TablesDb.kt new file mode 100644 index 0000000..a8229df --- /dev/null +++ b/src/main/kotlin/io/appwrite/services/TablesDb.kt @@ -0,0 +1,2408 @@ +package io.appwrite.services + +import io.appwrite.Client +import io.appwrite.models.* +import io.appwrite.enums.* +import io.appwrite.exceptions.AppwriteException +import io.appwrite.extensions.classOf +import okhttp3.Cookie +import java.io.File + +/** + * +**/ +class TablesDB(client: Client) : Service(client) { + + /** + * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. + * + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name + * @param search Search term to filter your list results. Max length: 256 chars. + * @return [io.appwrite.models.DatabaseList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun list( + queries: List? = null, + search: String? = null, + ): io.appwrite.models.DatabaseList { + val apiPath = "/tablesdb" + + val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.DatabaseList = { + io.appwrite.models.DatabaseList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.DatabaseList::class.java, + converter, + ) + } + + /** + * Create a new Database. + * + * + * @param databaseId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Database name. Max length: 128 chars. + * @param enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @return [io.appwrite.models.Database] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun create( + databaseId: String, + name: String, + enabled: Boolean? = null, + ): io.appwrite.models.Database { + val apiPath = "/tablesdb" + + val apiParams = mutableMapOf( + "databaseId" to databaseId, + "name" to name, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. + * + * @param databaseId Database ID. + * @return [io.appwrite.models.Database] + */ + @Throws(AppwriteException::class) + suspend fun get( + databaseId: String, + ): io.appwrite.models.Database { + val apiPath = "/tablesdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * Update a database by its unique ID. + * + * @param databaseId Database ID. + * @param name Database name. Max length: 128 chars. + * @param enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @return [io.appwrite.models.Database] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun update( + databaseId: String, + name: String, + enabled: Boolean? = null, + ): io.appwrite.models.Database { + val apiPath = "/tablesdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "name" to name, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Database = { + io.appwrite.models.Database.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Database::class.java, + converter, + ) + } + + /** + * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. + * + * @param databaseId Database ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun delete( + databaseId: String, + ): Any { + val apiPath = "/tablesdb/{databaseId}" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results. + * + * @param databaseId Database ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity + * @param search Search term to filter your list results. Max length: 256 chars. + * @return [io.appwrite.models.TableList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listTables( + databaseId: String, + queries: List? = null, + search: String? = null, + ): io.appwrite.models.TableList { + val apiPath = "/tablesdb/{databaseId}/tables" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.TableList = { + io.appwrite.models.TableList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.TableList::class.java, + converter, + ) + } + + /** + * Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * @param databaseId Database ID. + * @param tableId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param name Table name. Max length: 128 chars. + * @param permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param rowSecurity Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + * @return [io.appwrite.models.Table] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createTable( + databaseId: String, + tableId: String, + name: String, + permissions: List? = null, + rowSecurity: Boolean? = null, + enabled: Boolean? = null, + ): io.appwrite.models.Table { + val apiPath = "/tablesdb/{databaseId}/tables" + .replace("{databaseId}", databaseId) + + val apiParams = mutableMapOf( + "tableId" to tableId, + "name" to name, + "permissions" to permissions, + "rowSecurity" to rowSecurity, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Table = { + io.appwrite.models.Table.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Table::class.java, + converter, + ) + } + + /** + * Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @return [io.appwrite.models.Table] + */ + @Throws(AppwriteException::class) + suspend fun getTable( + databaseId: String, + tableId: String, + ): io.appwrite.models.Table { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Table = { + io.appwrite.models.Table.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Table::class.java, + converter, + ) + } + + /** + * Update a table by its unique ID. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param name Table name. Max length: 128 chars. + * @param permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param rowSecurity Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + * @return [io.appwrite.models.Table] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateTable( + databaseId: String, + tableId: String, + name: String, + permissions: List? = null, + rowSecurity: Boolean? = null, + enabled: Boolean? = null, + ): io.appwrite.models.Table { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "name" to name, + "permissions" to permissions, + "rowSecurity" to rowSecurity, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Table = { + io.appwrite.models.Table.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Table::class.java, + converter, + ) + } + + /** + * Delete a table by its unique ID. Only users with write permissions have access to delete this resource. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteTable( + databaseId: String, + tableId: String, + ): Any { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * List columns in the table. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error + * @return [io.appwrite.models.ColumnList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listColumns( + databaseId: String, + tableId: String, + queries: List? = null, + ): io.appwrite.models.ColumnList { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.ColumnList = { + io.appwrite.models.ColumnList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnList::class.java, + converter, + ) + } + + /** + * Create a boolean column. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param key Column Key. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param array Is column an array? + * @return [io.appwrite.models.ColumnBoolean] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createBooleanColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: Boolean? = null, + array: Boolean? = null, + ): io.appwrite.models.ColumnBoolean { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "required" to required, + "default" to default, + "array" to array, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnBoolean = { + io.appwrite.models.ColumnBoolean.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnBoolean::class.java, + converter, + ) + } + + /** + * Update a boolean column. Changing the `default` value will not update already existing rows. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param key Column Key. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnBoolean] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateBooleanColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: Boolean? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnBoolean { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "required" to required, + "default" to default, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnBoolean = { + io.appwrite.models.ColumnBoolean.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnBoolean::class.java, + converter, + ) + } + + /** + * Create a date time column according to the ISO 8601 standard. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. + * @param array Is column an array? + * @return [io.appwrite.models.ColumnDatetime] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createDatetimeColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + array: Boolean? = null, + ): io.appwrite.models.ColumnDatetime { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "required" to required, + "default" to default, + "array" to array, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnDatetime = { + io.appwrite.models.ColumnDatetime.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnDatetime::class.java, + converter, + ) + } + + /** + * Update a date time column. Changing the `default` value will not update already existing rows. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnDatetime] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateDatetimeColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnDatetime { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "required" to required, + "default" to default, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnDatetime = { + io.appwrite.models.ColumnDatetime.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnDatetime::class.java, + converter, + ) + } + + /** + * Create an email column. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param array Is column an array? + * @return [io.appwrite.models.ColumnEmail] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createEmailColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + array: Boolean? = null, + ): io.appwrite.models.ColumnEmail { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "required" to required, + "default" to default, + "array" to array, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnEmail = { + io.appwrite.models.ColumnEmail.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnEmail::class.java, + converter, + ) + } + + /** + * Update an email column. Changing the `default` value will not update already existing rows. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnEmail] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateEmailColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnEmail { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "required" to required, + "default" to default, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnEmail = { + io.appwrite.models.ColumnEmail.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnEmail::class.java, + converter, + ) + } + + /** + * Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param elements Array of enum values. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param array Is column an array? + * @return [io.appwrite.models.ColumnEnum] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createEnumColumn( + databaseId: String, + tableId: String, + key: String, + elements: List, + required: Boolean, + default: String? = null, + array: Boolean? = null, + ): io.appwrite.models.ColumnEnum { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "elements" to elements, + "required" to required, + "default" to default, + "array" to array, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnEnum = { + io.appwrite.models.ColumnEnum.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnEnum::class.java, + converter, + ) + } + + /** + * Update an enum column. Changing the `default` value will not update already existing rows. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param elements Updated list of enum values. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnEnum] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateEnumColumn( + databaseId: String, + tableId: String, + key: String, + elements: List, + required: Boolean, + default: String? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnEnum { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "elements" to elements, + "required" to required, + "default" to default, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnEnum = { + io.appwrite.models.ColumnEnum.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnEnum::class.java, + converter, + ) + } + + /** + * Create a float column. Optionally, minimum and maximum values can be provided. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param min Minimum value + * @param max Maximum value + * @param default Default value. Cannot be set when required. + * @param array Is column an array? + * @return [io.appwrite.models.ColumnFloat] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createFloatColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + min: Double? = null, + max: Double? = null, + default: Double? = null, + array: Boolean? = null, + ): io.appwrite.models.ColumnFloat { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "required" to required, + "min" to min, + "max" to max, + "default" to default, + "array" to array, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnFloat = { + io.appwrite.models.ColumnFloat.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnFloat::class.java, + converter, + ) + } + + /** + * Update a float column. Changing the `default` value will not update already existing rows. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value. Cannot be set when required. + * @param min Minimum value + * @param max Maximum value + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnFloat] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateFloatColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: Double? = null, + min: Double? = null, + max: Double? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnFloat { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "required" to required, + "min" to min, + "max" to max, + "default" to default, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnFloat = { + io.appwrite.models.ColumnFloat.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnFloat::class.java, + converter, + ) + } + + /** + * Create an integer column. Optionally, minimum and maximum values can be provided. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param min Minimum value + * @param max Maximum value + * @param default Default value. Cannot be set when column is required. + * @param array Is column an array? + * @return [io.appwrite.models.ColumnInteger] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createIntegerColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + min: Long? = null, + max: Long? = null, + default: Long? = null, + array: Boolean? = null, + ): io.appwrite.models.ColumnInteger { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "required" to required, + "min" to min, + "max" to max, + "default" to default, + "array" to array, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnInteger = { + io.appwrite.models.ColumnInteger.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnInteger::class.java, + converter, + ) + } + + /** + * Update an integer column. Changing the `default` value will not update already existing rows. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value. Cannot be set when column is required. + * @param min Minimum value + * @param max Maximum value + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnInteger] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateIntegerColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: Long? = null, + min: Long? = null, + max: Long? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnInteger { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "required" to required, + "min" to min, + "max" to max, + "default" to default, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnInteger = { + io.appwrite.models.ColumnInteger.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnInteger::class.java, + converter, + ) + } + + /** + * Create IP address column. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value. Cannot be set when column is required. + * @param array Is column an array? + * @return [io.appwrite.models.ColumnIp] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createIpColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + array: Boolean? = null, + ): io.appwrite.models.ColumnIp { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "required" to required, + "default" to default, + "array" to array, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnIp = { + io.appwrite.models.ColumnIp.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnIp::class.java, + converter, + ) + } + + /** + * Update an ip column. Changing the `default` value will not update already existing rows. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value. Cannot be set when column is required. + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnIp] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateIpColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnIp { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "required" to required, + "default" to default, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnIp = { + io.appwrite.models.ColumnIp.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnIp::class.java, + converter, + ) + } + + /** + * Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param relatedTableId Related Table ID. + * @param type Relation type + * @param twoWay Is Two Way? + * @param key Column Key. + * @param twoWayKey Two Way Column Key. + * @param onDelete Constraints option + * @return [io.appwrite.models.ColumnRelationship] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createRelationshipColumn( + databaseId: String, + tableId: String, + relatedTableId: String, + type: io.appwrite.enums.RelationshipType, + twoWay: Boolean? = null, + key: String? = null, + twoWayKey: String? = null, + onDelete: io.appwrite.enums.RelationMutate? = null, + ): io.appwrite.models.ColumnRelationship { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/relationship" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "relatedTableId" to relatedTableId, + "type" to type, + "twoWay" to twoWay, + "key" to key, + "twoWayKey" to twoWayKey, + "onDelete" to onDelete, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnRelationship = { + io.appwrite.models.ColumnRelationship.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnRelationship::class.java, + converter, + ) + } + + /** + * Create a string column. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param key Column Key. + * @param size Column size for text columns, in number of characters. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param array Is column an array? + * @param encrypt Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @return [io.appwrite.models.ColumnString] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createStringColumn( + databaseId: String, + tableId: String, + key: String, + size: Long, + required: Boolean, + default: String? = null, + array: Boolean? = null, + encrypt: Boolean? = null, + ): io.appwrite.models.ColumnString { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "size" to size, + "required" to required, + "default" to default, + "array" to array, + "encrypt" to encrypt, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnString = { + io.appwrite.models.ColumnString.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnString::class.java, + converter, + ) + } + + /** + * Update a string column. Changing the `default` value will not update already existing rows. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param key Column Key. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param size Maximum size of the string column. + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnString] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateStringColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + size: Long? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnString { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "required" to required, + "default" to default, + "size" to size, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnString = { + io.appwrite.models.ColumnString.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnString::class.java, + converter, + ) + } + + /** + * Create a URL column. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param array Is column an array? + * @return [io.appwrite.models.ColumnUrl] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createUrlColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + array: Boolean? = null, + ): io.appwrite.models.ColumnUrl { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "required" to required, + "default" to default, + "array" to array, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnUrl = { + io.appwrite.models.ColumnUrl.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnUrl::class.java, + converter, + ) + } + + /** + * Update an url column. Changing the `default` value will not update already existing rows. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param required Is column required? + * @param default Default value for column when not provided. Cannot be set when column is required. + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnUrl] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateUrlColumn( + databaseId: String, + tableId: String, + key: String, + required: Boolean, + default: String? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnUrl { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "required" to required, + "default" to default, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnUrl = { + io.appwrite.models.ColumnUrl.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnUrl::class.java, + converter, + ) + } + + /** + * Get column by ID. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun getColumn( + databaseId: String, + tableId: String, + key: String, + ): Any { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Deletes a column. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteColumn( + databaseId: String, + tableId: String, + key: String, + ): Any { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param key Column Key. + * @param onDelete Constraints option + * @param newKey New Column Key. + * @return [io.appwrite.models.ColumnRelationship] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateRelationshipColumn( + databaseId: String, + tableId: String, + key: String, + onDelete: io.appwrite.enums.RelationMutate? = null, + newKey: String? = null, + ): io.appwrite.models.ColumnRelationship { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + "onDelete" to onDelete, + "newKey" to newKey, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnRelationship = { + io.appwrite.models.ColumnRelationship.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnRelationship::class.java, + converter, + ) + } + + /** + * List indexes on the table. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error + * @return [io.appwrite.models.ColumnIndexList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listIndexes( + databaseId: String, + tableId: String, + queries: List? = null, + ): io.appwrite.models.ColumnIndexList { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.ColumnIndexList = { + io.appwrite.models.ColumnIndexList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnIndexList::class.java, + converter, + ) + } + + /** + * Creates an index on the columns listed. Your index should include all the columns you will query in a single request. + * Type can be `key`, `fulltext`, or `unique`. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param key Index Key. + * @param type Index type. + * @param columns Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. + * @param orders Array of index orders. Maximum of 100 orders are allowed. + * @param lengths Length of index. Maximum of 100 + * @return [io.appwrite.models.ColumnIndex] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createIndex( + databaseId: String, + tableId: String, + key: String, + type: io.appwrite.enums.IndexType, + columns: List, + orders: List? = null, + lengths: List? = null, + ): io.appwrite.models.ColumnIndex { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "key" to key, + "type" to type, + "columns" to columns, + "orders" to orders, + "lengths" to lengths, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ColumnIndex = { + io.appwrite.models.ColumnIndex.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnIndex::class.java, + converter, + ) + } + + /** + * Get index by ID. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param key Index Key. + * @return [io.appwrite.models.ColumnIndex] + */ + @Throws(AppwriteException::class) + suspend fun getIndex( + databaseId: String, + tableId: String, + key: String, + ): io.appwrite.models.ColumnIndex { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.ColumnIndex = { + io.appwrite.models.ColumnIndex.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ColumnIndex::class.java, + converter, + ) + } + + /** + * Delete an index. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param key Index Key. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteIndex( + databaseId: String, + tableId: String, + key: String, + ): Any { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{key}", key) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Get a list of all the user's rows in a given table. You can use the query params to filter your results. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.RowList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listRows( + databaseId: String, + tableId: String, + queries: List? = null, + nestedType: Class, + ): io.appwrite.models.RowList { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.RowList = { + io.appwrite.models.RowList.from(map = it as Map, nestedType) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Get a list of all the user's rows in a given table. You can use the query params to filter your results. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.RowList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun listRows( + databaseId: String, + tableId: String, + queries: List? = null, + ): io.appwrite.models.RowList> = listRows( + databaseId, + tableId, + queries, + nestedType = classOf(), + ) + + /** + * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @param rowId Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param data Row data as JSON object. + * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createRow( + databaseId: String, + tableId: String, + rowId: String, + data: Any, + permissions: List? = null, + nestedType: Class, + ): io.appwrite.models.Row { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "rowId" to rowId, + "data" to data, + "permissions" to permissions, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Row = { + io.appwrite.models.Row.from(map = it as Map, nestedType) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @param rowId Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param data Row data as JSON object. + * @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createRow( + databaseId: String, + tableId: String, + rowId: String, + data: Any, + permissions: List? = null, + ): io.appwrite.models.Row> = createRow( + databaseId, + tableId, + rowId, + data, + permissions, + nestedType = classOf(), + ) + + /** + * Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @param rows Array of documents data as JSON objects. + * @return [io.appwrite.models.RowList] + */ + @Throws(AppwriteException::class) + suspend fun createRows( + databaseId: String, + tableId: String, + rows: List, + nestedType: Class, + ): io.appwrite.models.RowList { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "rows" to rows, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.RowList = { + io.appwrite.models.RowList.from(map = it as Map, nestedType) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @param rows Array of documents data as JSON objects. + * @return [io.appwrite.models.RowList] + */ + @Throws(AppwriteException::class) + suspend fun createRows( + databaseId: String, + tableId: String, + rows: List, + ): io.appwrite.models.RowList> = createRows( + databaseId, + tableId, + rows, + nestedType = classOf(), + ) + + /** + * Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rows Array of row data as JSON objects. May contain partial rows. + * @return [io.appwrite.models.RowList] + */ + @Throws(AppwriteException::class) + suspend fun upsertRows( + databaseId: String, + tableId: String, + rows: List, + nestedType: Class, + ): io.appwrite.models.RowList { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "rows" to rows, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.RowList = { + io.appwrite.models.RowList.from(map = it as Map, nestedType) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rows Array of row data as JSON objects. May contain partial rows. + * @return [io.appwrite.models.RowList] + */ + @Throws(AppwriteException::class) + suspend fun upsertRows( + databaseId: String, + tableId: String, + rows: List, + ): io.appwrite.models.RowList> = upsertRows( + databaseId, + tableId, + rows, + nestedType = classOf(), + ) + + /** + * Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param data Row data as JSON object. Include only column and value pairs to be updated. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.RowList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateRows( + databaseId: String, + tableId: String, + data: Any? = null, + queries: List? = null, + nestedType: Class, + ): io.appwrite.models.RowList { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "data" to data, + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.RowList = { + io.appwrite.models.RowList.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param data Row data as JSON object. Include only column and value pairs to be updated. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.RowList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateRows( + databaseId: String, + tableId: String, + data: Any? = null, + queries: List? = null, + ): io.appwrite.models.RowList> = updateRows( + databaseId, + tableId, + data, + queries, + nestedType = classOf(), + ) + + /** + * Bulk delete rows using queries, if no queries are passed then all rows are deleted. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.RowList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteRows( + databaseId: String, + tableId: String, + queries: List? = null, + nestedType: Class, + ): io.appwrite.models.RowList { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.RowList = { + io.appwrite.models.RowList.from(map = it as Map, nestedType) + } + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Bulk delete rows using queries, if no queries are passed then all rows are deleted. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.RowList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun deleteRows( + databaseId: String, + tableId: String, + queries: List? = null, + ): io.appwrite.models.RowList> = deleteRows( + databaseId, + tableId, + queries, + nestedType = classOf(), + ) + + /** + * Get a row by its unique ID. This endpoint response returns a JSON object with the row data. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param rowId Row ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getRow( + databaseId: String, + tableId: String, + rowId: String, + queries: List? = null, + nestedType: Class, + ): io.appwrite.models.Row { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{rowId}", rowId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.Row = { + io.appwrite.models.Row.from(map = it as Map, nestedType) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Get a row by its unique ID. This endpoint response returns a JSON object with the row data. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param rowId Row ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun getRow( + databaseId: String, + tableId: String, + rowId: String, + queries: List? = null, + ): io.appwrite.models.Row> = getRow( + databaseId, + tableId, + rowId, + queries, + nestedType = classOf(), + ) + + /** + * Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rowId Row ID. + * @param data Row data as JSON object. Include all required columns of the row to be created or updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertRow( + databaseId: String, + tableId: String, + rowId: String, + data: Any? = null, + permissions: List? = null, + nestedType: Class, + ): io.appwrite.models.Row { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{rowId}", rowId) + + val apiParams = mutableMapOf( + "data" to data, + "permissions" to permissions, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Row = { + io.appwrite.models.Row.from(map = it as Map, nestedType) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rowId Row ID. + * @param data Row data as JSON object. Include all required columns of the row to be created or updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun upsertRow( + databaseId: String, + tableId: String, + rowId: String, + data: Any? = null, + permissions: List? = null, + ): io.appwrite.models.Row> = upsertRow( + databaseId, + tableId, + rowId, + data, + permissions, + nestedType = classOf(), + ) + + /** + * Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rowId Row ID. + * @param data Row data as JSON object. Include only columns and value pairs to be updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateRow( + databaseId: String, + tableId: String, + rowId: String, + data: Any? = null, + permissions: List? = null, + nestedType: Class, + ): io.appwrite.models.Row { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{rowId}", rowId) + + val apiParams = mutableMapOf( + "data" to data, + "permissions" to permissions, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Row = { + io.appwrite.models.Row.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rowId Row ID. + * @param data Row data as JSON object. Include only columns and value pairs to be updated. + * @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateRow( + databaseId: String, + tableId: String, + rowId: String, + data: Any? = null, + permissions: List? = null, + ): io.appwrite.models.Row> = updateRow( + databaseId, + tableId, + rowId, + data, + permissions, + nestedType = classOf(), + ) + + /** + * Delete a row by its unique ID. + * + * @param databaseId Database ID. + * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @param rowId Row ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteRow( + databaseId: String, + tableId: String, + rowId: String, + ): Any { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{rowId}", rowId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** + * Decrement a specific column of a row by a given value. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rowId Row ID. + * @param column Column key. + * @param value Value to increment the column by. The value must be a number. + * @param min Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun decrementRowColumn( + databaseId: String, + tableId: String, + rowId: String, + column: String, + value: Double? = null, + min: Double? = null, + nestedType: Class, + ): io.appwrite.models.Row { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{rowId}", rowId) + .replace("{column}", column) + + val apiParams = mutableMapOf( + "value" to value, + "min" to min, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Row = { + io.appwrite.models.Row.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Decrement a specific column of a row by a given value. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rowId Row ID. + * @param column Column key. + * @param value Value to increment the column by. The value must be a number. + * @param min Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun decrementRowColumn( + databaseId: String, + tableId: String, + rowId: String, + column: String, + value: Double? = null, + min: Double? = null, + ): io.appwrite.models.Row> = decrementRowColumn( + databaseId, + tableId, + rowId, + column, + value, + min, + nestedType = classOf(), + ) + + /** + * Increment a specific column of a row by a given value. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rowId Row ID. + * @param column Column key. + * @param value Value to increment the column by. The value must be a number. + * @param max Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun incrementRowColumn( + databaseId: String, + tableId: String, + rowId: String, + column: String, + value: Double? = null, + max: Double? = null, + nestedType: Class, + ): io.appwrite.models.Row { + val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment" + .replace("{databaseId}", databaseId) + .replace("{tableId}", tableId) + .replace("{rowId}", rowId) + .replace("{column}", column) + + val apiParams = mutableMapOf( + "value" to value, + "max" to max, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Row = { + io.appwrite.models.Row.from(map = it as Map, nestedType) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = classOf(), + converter, + ) + } + + /** + * Increment a specific column of a row by a given value. + * + * @param databaseId Database ID. + * @param tableId Table ID. + * @param rowId Row ID. + * @param column Column key. + * @param value Value to increment the column by. The value must be a number. + * @param max Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @return [io.appwrite.models.Row] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun incrementRowColumn( + databaseId: String, + tableId: String, + rowId: String, + column: String, + value: Double? = null, + max: Double? = null, + ): io.appwrite.models.Row> = incrementRowColumn( + databaseId, + tableId, + rowId, + column, + value, + max, + nestedType = classOf(), + ) + +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/Teams.kt b/src/main/kotlin/io/appwrite/services/Teams.kt index aa355dc..923a01b 100644 --- a/src/main/kotlin/io/appwrite/services/Teams.kt +++ b/src/main/kotlin/io/appwrite/services/Teams.kt @@ -14,8 +14,6 @@ import java.io.File class Teams(client: Client) : Service(client) { /** - * List teams - * * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan @@ -35,8 +33,7 @@ class Teams(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.TeamList = { io.appwrite.models.TeamList.from(map = it as Map, nestedType) @@ -52,8 +49,6 @@ class Teams(client: Client) : Service(client) { } /** - * List teams - * * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan @@ -72,8 +67,6 @@ class Teams(client: Client) : Service(client) { ) /** - * Create team - * * Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. * * @param teamId Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -96,7 +89,7 @@ class Teams(client: Client) : Service(client) { "name" to name, "roles" to roles, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Team = { @@ -113,8 +106,6 @@ class Teams(client: Client) : Service(client) { } /** - * Create team - * * Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. * * @param teamId Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -136,8 +127,6 @@ class Teams(client: Client) : Service(client) { ) /** - * Get team - * * Get a team by its ID. All team members have read access for this resource. * * @param teamId Team ID. @@ -153,8 +142,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Team = { io.appwrite.models.Team.from(map = it as Map, nestedType) @@ -170,8 +158,6 @@ class Teams(client: Client) : Service(client) { } /** - * Get team - * * Get a team by its ID. All team members have read access for this resource. * * @param teamId Team ID. @@ -186,9 +172,7 @@ class Teams(client: Client) : Service(client) { ) /** - * Update name - * - * Update the team's name by its unique ID. + * Update the team's name by its unique ID. * * @param teamId Team ID. * @param name New team name. Max length: 128 chars. @@ -206,7 +190,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Team = { @@ -223,9 +207,7 @@ class Teams(client: Client) : Service(client) { } /** - * Update name - * - * Update the team's name by its unique ID. + * Update the team's name by its unique ID. * * @param teamId Team ID. * @param name New team name. Max length: 128 chars. @@ -242,8 +224,6 @@ class Teams(client: Client) : Service(client) { ) /** - * Delete team - * * Delete a team using its ID. Only team members with the owner role can delete the team. * * @param teamId Team ID. @@ -258,7 +238,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -271,12 +251,10 @@ class Teams(client: Client) : Service(client) { } /** - * List team memberships - * - * Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. + * Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. * * @param teamId Team ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles * @param search Search term to filter your list results. Max length: 256 chars. * @return [io.appwrite.models.MembershipList] */ @@ -294,8 +272,7 @@ class Teams(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.MembershipList = { io.appwrite.models.MembershipList.from(map = it as Map) @@ -311,9 +288,14 @@ class Teams(client: Client) : Service(client) { } /** - * Create team membership - * - * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. + * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. + * + * You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. + * + * Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. + * + * Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. + * * * @param teamId Team ID. * @param roles Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. @@ -346,7 +328,7 @@ class Teams(client: Client) : Service(client) { "url" to url, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Membership = { @@ -363,8 +345,6 @@ class Teams(client: Client) : Service(client) { } /** - * Get team membership - * * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. * * @param teamId Team ID. @@ -382,8 +362,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Membership = { io.appwrite.models.Membership.from(map = it as Map) @@ -399,9 +378,8 @@ class Teams(client: Client) : Service(client) { } /** - * Update membership - * * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). + * * * @param teamId Team ID. * @param membershipId Membership ID. @@ -421,7 +399,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( "roles" to roles, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Membership = { @@ -438,8 +416,6 @@ class Teams(client: Client) : Service(client) { } /** - * Delete team membership - * * This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted. * * @param teamId Team ID. @@ -457,7 +433,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -470,9 +446,10 @@ class Teams(client: Client) : Service(client) { } /** - * Update team membership status - * - * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.If the request is successful, a session for the user is automatically created. + * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user. + * + * If the request is successful, a session for the user is automatically created. + * * * @param teamId Team ID. * @param membershipId Membership ID. @@ -495,7 +472,7 @@ class Teams(client: Client) : Service(client) { "userId" to userId, "secret" to secret, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Membership = { @@ -512,9 +489,7 @@ class Teams(client: Client) : Service(client) { } /** - * Get team preferences - * - * Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). + * Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). * * @param teamId Team ID. * @return [io.appwrite.models.Preferences] @@ -529,8 +504,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Preferences = { io.appwrite.models.Preferences.from(map = it as Map, nestedType) @@ -546,9 +520,7 @@ class Teams(client: Client) : Service(client) { } /** - * Get team preferences - * - * Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). + * Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). * * @param teamId Team ID. * @return [io.appwrite.models.Preferences] @@ -562,9 +534,7 @@ class Teams(client: Client) : Service(client) { ) /** - * Update preferences - * - * Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. + * Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. * * @param teamId Team ID. * @param prefs Prefs key-value JSON object. @@ -582,7 +552,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( "prefs" to prefs, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Preferences = { @@ -599,9 +569,7 @@ class Teams(client: Client) : Service(client) { } /** - * Update preferences - * - * Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. + * Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. * * @param teamId Team ID. * @param prefs Prefs key-value JSON object. diff --git a/src/main/kotlin/io/appwrite/services/Tokens.kt b/src/main/kotlin/io/appwrite/services/Tokens.kt new file mode 100644 index 0000000..088b069 --- /dev/null +++ b/src/main/kotlin/io/appwrite/services/Tokens.kt @@ -0,0 +1,183 @@ +package io.appwrite.services + +import io.appwrite.Client +import io.appwrite.models.* +import io.appwrite.enums.* +import io.appwrite.exceptions.AppwriteException +import io.appwrite.extensions.classOf +import okhttp3.Cookie +import java.io.File + +/** + * +**/ +class Tokens(client: Client) : Service(client) { + + /** + * List all the tokens created for a specific file or bucket. You can use the query params to filter your results. + * + * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + * @param fileId File unique ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire + * @return [io.appwrite.models.ResourceTokenList] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun list( + bucketId: String, + fileId: String, + queries: List? = null, + ): io.appwrite.models.ResourceTokenList { + val apiPath = "/tokens/buckets/{bucketId}/files/{fileId}" + .replace("{bucketId}", bucketId) + .replace("{fileId}", fileId) + + val apiParams = mutableMapOf( + "queries" to queries, + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.ResourceTokenList = { + io.appwrite.models.ResourceTokenList.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ResourceTokenList::class.java, + converter, + ) + } + + /** + * Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. + * + * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). + * @param fileId File unique ID. + * @param expire Token expiry date + * @return [io.appwrite.models.ResourceToken] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createFileToken( + bucketId: String, + fileId: String, + expire: String? = null, + ): io.appwrite.models.ResourceToken { + val apiPath = "/tokens/buckets/{bucketId}/files/{fileId}" + .replace("{bucketId}", bucketId) + .replace("{fileId}", fileId) + + val apiParams = mutableMapOf( + "expire" to expire, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ResourceToken = { + io.appwrite.models.ResourceToken.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ResourceToken::class.java, + converter, + ) + } + + /** + * Get a token by its unique ID. + * + * @param tokenId Token ID. + * @return [io.appwrite.models.ResourceToken] + */ + @Throws(AppwriteException::class) + suspend fun get( + tokenId: String, + ): io.appwrite.models.ResourceToken { + val apiPath = "/tokens/{tokenId}" + .replace("{tokenId}", tokenId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.ResourceToken = { + io.appwrite.models.ResourceToken.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ResourceToken::class.java, + converter, + ) + } + + /** + * Update a token by its unique ID. Use this endpoint to update a token's expiry date. + * + * @param tokenId Token unique ID. + * @param expire File token expiry date + * @return [io.appwrite.models.ResourceToken] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun update( + tokenId: String, + expire: String? = null, + ): io.appwrite.models.ResourceToken { + val apiPath = "/tokens/{tokenId}" + .replace("{tokenId}", tokenId) + + val apiParams = mutableMapOf( + "expire" to expire, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.ResourceToken = { + io.appwrite.models.ResourceToken.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.ResourceToken::class.java, + converter, + ) + } + + /** + * Delete a token by its unique ID. + * + * @param tokenId Token ID. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun delete( + tokenId: String, + ): Any { + val apiPath = "/tokens/{tokenId}" + .replace("{tokenId}", tokenId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/services/Users.kt b/src/main/kotlin/io/appwrite/services/Users.kt index 28c3cf3..26337e9 100644 --- a/src/main/kotlin/io/appwrite/services/Users.kt +++ b/src/main/kotlin/io/appwrite/services/Users.kt @@ -14,9 +14,7 @@ import java.io.File class Users(client: Client) : Service(client) { /** - * List users - * - * Get a list of all the project's users. You can use the query params to filter your results. + * Get a list of all the project's users. You can use the query params to filter your results. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels * @param search Search term to filter your list results. Max length: 256 chars. @@ -35,8 +33,7 @@ class Users(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.UserList = { io.appwrite.models.UserList.from(map = it as Map, nestedType) @@ -52,9 +49,7 @@ class Users(client: Client) : Service(client) { } /** - * List users - * - * Get a list of all the project's users. You can use the query params to filter your results. + * Get a list of all the project's users. You can use the query params to filter your results. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels * @param search Search term to filter your list results. Max length: 256 chars. @@ -72,8 +67,6 @@ class Users(client: Client) : Service(client) { ) /** - * Create user - * * Create a new user. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -102,7 +95,7 @@ class Users(client: Client) : Service(client) { "password" to password, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -119,8 +112,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user - * * Create a new user. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -148,8 +139,6 @@ class Users(client: Client) : Service(client) { ) /** - * Create user with Argon2 password - * * Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -175,7 +164,7 @@ class Users(client: Client) : Service(client) { "password" to password, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -192,8 +181,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user with Argon2 password - * * Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -218,8 +205,6 @@ class Users(client: Client) : Service(client) { ) /** - * Create user with bcrypt password - * * Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -245,7 +230,7 @@ class Users(client: Client) : Service(client) { "password" to password, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -262,8 +247,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user with bcrypt password - * * Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -288,8 +271,6 @@ class Users(client: Client) : Service(client) { ) /** - * List identities - * * Get identities for all users. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry @@ -308,8 +289,7 @@ class Users(client: Client) : Service(client) { "queries" to queries, "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.IdentityList = { io.appwrite.models.IdentityList.from(map = it as Map) @@ -325,8 +305,6 @@ class Users(client: Client) : Service(client) { } /** - * Delete identity - * * Delete an identity by its unique ID. * * @param identityId Identity ID. @@ -341,7 +319,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -354,8 +332,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user with MD5 password - * * Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -381,7 +357,7 @@ class Users(client: Client) : Service(client) { "password" to password, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -398,8 +374,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user with MD5 password - * * Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -424,8 +398,6 @@ class Users(client: Client) : Service(client) { ) /** - * Create user with PHPass password - * * Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -451,7 +423,7 @@ class Users(client: Client) : Service(client) { "password" to password, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -468,8 +440,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user with PHPass password - * * Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -494,8 +464,6 @@ class Users(client: Client) : Service(client) { ) /** - * Create user with Scrypt password - * * Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -536,7 +504,7 @@ class Users(client: Client) : Service(client) { "passwordLength" to passwordLength, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -553,8 +521,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user with Scrypt password - * * Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -594,8 +560,6 @@ class Users(client: Client) : Service(client) { ) /** - * Create user with Scrypt modified password - * * Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -630,7 +594,7 @@ class Users(client: Client) : Service(client) { "passwordSignerKey" to passwordSignerKey, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -647,8 +611,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user with Scrypt modified password - * * Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -682,8 +644,6 @@ class Users(client: Client) : Service(client) { ) /** - * Create user with SHA password - * * Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -712,7 +672,7 @@ class Users(client: Client) : Service(client) { "passwordVersion" to passwordVersion, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -729,8 +689,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user with SHA password - * * Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -758,8 +716,6 @@ class Users(client: Client) : Service(client) { ) /** - * Get user - * * Get a user by its unique ID. * * @param userId User ID. @@ -775,8 +731,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.User = { io.appwrite.models.User.from(map = it as Map, nestedType) @@ -792,8 +747,6 @@ class Users(client: Client) : Service(client) { } /** - * Get user - * * Get a user by its unique ID. * * @param userId User ID. @@ -808,9 +761,7 @@ class Users(client: Client) : Service(client) { ) /** - * Delete user - * - * Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. + * Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. * * @param userId User ID. * @return [Any] @@ -824,7 +775,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -837,8 +788,6 @@ class Users(client: Client) : Service(client) { } /** - * Update email - * * Update the user email by its unique ID. * * @param userId User ID. @@ -857,7 +806,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "email" to email, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -874,8 +823,6 @@ class Users(client: Client) : Service(client) { } /** - * Update email - * * Update the user email by its unique ID. * * @param userId User ID. @@ -893,8 +840,6 @@ class Users(client: Client) : Service(client) { ) /** - * Create user JWT - * * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. * * @param userId User ID. @@ -916,7 +861,7 @@ class Users(client: Client) : Service(client) { "sessionId" to sessionId, "duration" to duration, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Jwt = { @@ -933,9 +878,9 @@ class Users(client: Client) : Service(client) { } /** - * Update user labels - * - * Update the user labels by its unique ID. Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. + * Update the user labels by its unique ID. + * + * Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. * * @param userId User ID. * @param labels Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. @@ -953,7 +898,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "labels" to labels, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -970,9 +915,9 @@ class Users(client: Client) : Service(client) { } /** - * Update user labels - * - * Update the user labels by its unique ID. Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. + * Update the user labels by its unique ID. + * + * Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. * * @param userId User ID. * @param labels Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. @@ -989,8 +934,6 @@ class Users(client: Client) : Service(client) { ) /** - * List user logs - * * Get the user activity logs list by its unique ID. * * @param userId User ID. @@ -1009,8 +952,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.LogList = { io.appwrite.models.LogList.from(map = it as Map) @@ -1026,24 +968,28 @@ class Users(client: Client) : Service(client) { } /** - * List user memberships - * * Get the user membership list by its unique ID. * * @param userId User ID. + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles + * @param search Search term to filter your list results. Max length: 256 chars. * @return [io.appwrite.models.MembershipList] */ + @JvmOverloads @Throws(AppwriteException::class) suspend fun listMemberships( userId: String, + queries: List? = null, + search: String? = null, ): io.appwrite.models.MembershipList { val apiPath = "/users/{userId}/memberships" .replace("{userId}", userId) val apiParams = mutableMapOf( + "queries" to queries, + "search" to search, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.MembershipList = { io.appwrite.models.MembershipList.from(map = it as Map) @@ -1059,14 +1005,16 @@ class Users(client: Client) : Service(client) { } /** - * Update MFA - * * Enable or disable MFA on a user account. * * @param userId User ID. * @param mfa Enable or disable MFA. * @return [io.appwrite.models.User] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Users.updateMFA") + ) @Throws(AppwriteException::class) suspend fun updateMfa( userId: String, @@ -1079,7 +1027,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "mfa" to mfa, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -1096,14 +1044,16 @@ class Users(client: Client) : Service(client) { } /** - * Update MFA - * * Enable or disable MFA on a user account. * * @param userId User ID. * @param mfa Enable or disable MFA. * @return [io.appwrite.models.User] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Users.updateMFA") + ) @Throws(AppwriteException::class) suspend fun updateMfa( userId: String, @@ -1115,34 +1065,32 @@ class Users(client: Client) : Service(client) { ) /** - * Delete authenticator - * - * Delete an authenticator app. + * Enable or disable MFA on a user account. * * @param userId User ID. - * @param type Type of authenticator. + * @param mfa Enable or disable MFA. * @return [io.appwrite.models.User] */ @Throws(AppwriteException::class) - suspend fun deleteMfaAuthenticator( + suspend fun updateMFA( userId: String, - type: io.appwrite.enums.AuthenticatorType, + mfa: Boolean, nestedType: Class, ): io.appwrite.models.User { - val apiPath = "/users/{userId}/mfa/authenticators/{type}" + val apiPath = "/users/{userId}/mfa" .replace("{userId}", userId) - .replace("{type}", type.value) val apiParams = mutableMapOf( + "mfa" to mfa, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { io.appwrite.models.User.from(map = it as Map, nestedType) } return client.call( - "DELETE", + "PATCH", apiPath, apiHeaders, apiParams, @@ -1152,32 +1100,96 @@ class Users(client: Client) : Service(client) { } /** - * Delete authenticator + * Enable or disable MFA on a user account. * + * @param userId User ID. + * @param mfa Enable or disable MFA. + * @return [io.appwrite.models.User] + */ + @Throws(AppwriteException::class) + suspend fun updateMFA( + userId: String, + mfa: Boolean, + ): io.appwrite.models.User> = updateMFA( + userId, + mfa, + nestedType = classOf(), + ) + + /** * Delete an authenticator app. * * @param userId User ID. * @param type Type of authenticator. - * @return [io.appwrite.models.User] + * @return [Any] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Users.deleteMFAAuthenticator` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Users.deleteMFAAuthenticator") + ) @Throws(AppwriteException::class) suspend fun deleteMfaAuthenticator( userId: String, type: io.appwrite.enums.AuthenticatorType, - ): io.appwrite.models.User> = deleteMfaAuthenticator( - userId, - type, - nestedType = classOf(), - ) + ): Any { + val apiPath = "/users/{userId}/mfa/authenticators/{type}" + .replace("{userId}", userId) + .replace("{type}", type.value) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } /** - * List factors + * Delete an authenticator app. * + * @param userId User ID. + * @param type Type of authenticator. + * @return [Any] + */ + @Throws(AppwriteException::class) + suspend fun deleteMFAAuthenticator( + userId: String, + type: io.appwrite.enums.AuthenticatorType, + ): Any { + val apiPath = "/users/{userId}/mfa/authenticators/{type}" + .replace("{userId}", userId) + .replace("{type}", type.value) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + return client.call( + "DELETE", + apiPath, + apiHeaders, + apiParams, + responseType = Any::class.java, + ) + } + + /** * List the factors available on the account to be used as a MFA challange. * * @param userId User ID. * @return [io.appwrite.models.MfaFactors] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Users.listMFAFactors` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Users.listMFAFactors") + ) @Throws(AppwriteException::class) suspend fun listMfaFactors( userId: String, @@ -1187,8 +1199,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.MfaFactors = { io.appwrite.models.MfaFactors.from(map = it as Map) @@ -1204,13 +1215,45 @@ class Users(client: Client) : Service(client) { } /** - * Get MFA recovery codes + * List the factors available on the account to be used as a MFA challange. * + * @param userId User ID. + * @return [io.appwrite.models.MfaFactors] + */ + @Throws(AppwriteException::class) + suspend fun listMFAFactors( + userId: String, + ): io.appwrite.models.MfaFactors { + val apiPath = "/users/{userId}/mfa/factors" + .replace("{userId}", userId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.MfaFactors = { + io.appwrite.models.MfaFactors.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaFactors::class.java, + converter, + ) + } + + /** * Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. * * @param userId User ID. * @return [io.appwrite.models.MfaRecoveryCodes] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Users.getMFARecoveryCodes` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Users.getMFARecoveryCodes") + ) @Throws(AppwriteException::class) suspend fun getMfaRecoveryCodes( userId: String, @@ -1220,8 +1263,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { io.appwrite.models.MfaRecoveryCodes.from(map = it as Map) @@ -1237,13 +1279,45 @@ class Users(client: Client) : Service(client) { } /** - * Regenerate MFA recovery codes + * Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. * + * @param userId User ID. + * @return [io.appwrite.models.MfaRecoveryCodes] + */ + @Throws(AppwriteException::class) + suspend fun getMFARecoveryCodes( + userId: String, + ): io.appwrite.models.MfaRecoveryCodes { + val apiPath = "/users/{userId}/mfa/recovery-codes" + .replace("{userId}", userId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + ) + val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { + io.appwrite.models.MfaRecoveryCodes.from(map = it as Map) + } + return client.call( + "GET", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaRecoveryCodes::class.java, + converter, + ) + } + + /** * Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. * * @param userId User ID. * @return [io.appwrite.models.MfaRecoveryCodes] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Users.updateMFARecoveryCodes` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Users.updateMFARecoveryCodes") + ) @Throws(AppwriteException::class) suspend fun updateMfaRecoveryCodes( userId: String, @@ -1253,7 +1327,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @@ -1270,13 +1344,46 @@ class Users(client: Client) : Service(client) { } /** - * Create MFA recovery codes + * Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. * + * @param userId User ID. + * @return [io.appwrite.models.MfaRecoveryCodes] + */ + @Throws(AppwriteException::class) + suspend fun updateMFARecoveryCodes( + userId: String, + ): io.appwrite.models.MfaRecoveryCodes { + val apiPath = "/users/{userId}/mfa/recovery-codes" + .replace("{userId}", userId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { + io.appwrite.models.MfaRecoveryCodes.from(map = it as Map) + } + return client.call( + "PUT", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaRecoveryCodes::class.java, + converter, + ) + } + + /** * Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. * * @param userId User ID. * @return [io.appwrite.models.MfaRecoveryCodes] */ + @Deprecated( + message = "This API has been deprecated since 1.8.0. Please use `Users.createMFARecoveryCodes` instead.", + replaceWith = ReplaceWith("io.appwrite.services.Users.createMFARecoveryCodes") + ) @Throws(AppwriteException::class) suspend fun createMfaRecoveryCodes( userId: String, @@ -1286,7 +1393,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @@ -1303,8 +1410,37 @@ class Users(client: Client) : Service(client) { } /** - * Update name + * Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. * + * @param userId User ID. + * @return [io.appwrite.models.MfaRecoveryCodes] + */ + @Throws(AppwriteException::class) + suspend fun createMFARecoveryCodes( + userId: String, + ): io.appwrite.models.MfaRecoveryCodes { + val apiPath = "/users/{userId}/mfa/recovery-codes" + .replace("{userId}", userId) + + val apiParams = mutableMapOf( + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { + io.appwrite.models.MfaRecoveryCodes.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.MfaRecoveryCodes::class.java, + converter, + ) + } + + /** * Update the user name by its unique ID. * * @param userId User ID. @@ -1323,7 +1459,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -1340,8 +1476,6 @@ class Users(client: Client) : Service(client) { } /** - * Update name - * * Update the user name by its unique ID. * * @param userId User ID. @@ -1359,8 +1493,6 @@ class Users(client: Client) : Service(client) { ) /** - * Update password - * * Update the user password by its unique ID. * * @param userId User ID. @@ -1379,7 +1511,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "password" to password, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -1396,8 +1528,6 @@ class Users(client: Client) : Service(client) { } /** - * Update password - * * Update the user password by its unique ID. * * @param userId User ID. @@ -1415,8 +1545,6 @@ class Users(client: Client) : Service(client) { ) /** - * Update phone - * * Update the user phone by its unique ID. * * @param userId User ID. @@ -1435,7 +1563,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "number" to number, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -1452,8 +1580,6 @@ class Users(client: Client) : Service(client) { } /** - * Update phone - * * Update the user phone by its unique ID. * * @param userId User ID. @@ -1471,8 +1597,6 @@ class Users(client: Client) : Service(client) { ) /** - * Get user preferences - * * Get the user preferences by its unique ID. * * @param userId User ID. @@ -1488,8 +1612,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Preferences = { io.appwrite.models.Preferences.from(map = it as Map, nestedType) @@ -1505,8 +1628,6 @@ class Users(client: Client) : Service(client) { } /** - * Get user preferences - * * Get the user preferences by its unique ID. * * @param userId User ID. @@ -1521,8 +1642,6 @@ class Users(client: Client) : Service(client) { ) /** - * Update user preferences - * * Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. * * @param userId User ID. @@ -1541,7 +1660,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "prefs" to prefs, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Preferences = { @@ -1558,8 +1677,6 @@ class Users(client: Client) : Service(client) { } /** - * Update user preferences - * * Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. * * @param userId User ID. @@ -1577,8 +1694,6 @@ class Users(client: Client) : Service(client) { ) /** - * List user sessions - * * Get the user sessions list by its unique ID. * * @param userId User ID. @@ -1593,8 +1708,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.SessionList = { io.appwrite.models.SessionList.from(map = it as Map) @@ -1610,9 +1724,9 @@ class Users(client: Client) : Service(client) { } /** - * Create session - * - * Creates a session for a user. Returns an immediately usable session object.If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint. + * Creates a session for a user. Returns an immediately usable session object. + * + * If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint. * * @param userId User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @return [io.appwrite.models.Session] @@ -1626,7 +1740,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @@ -1643,9 +1757,7 @@ class Users(client: Client) : Service(client) { } /** - * Delete user sessions - * - * Delete all user's sessions by using the user's unique ID. + * Delete all user's sessions by using the user's unique ID. * * @param userId User ID. * @return [Any] @@ -1659,7 +1771,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -1672,8 +1784,6 @@ class Users(client: Client) : Service(client) { } /** - * Delete user session - * * Delete a user sessions by its unique ID. * * @param userId User ID. @@ -1691,7 +1801,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -1704,9 +1814,7 @@ class Users(client: Client) : Service(client) { } /** - * Update user status - * - * Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. + * Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. * * @param userId User ID. * @param status User Status. To activate the user pass `true` and to block the user pass `false`. @@ -1724,7 +1832,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "status" to status, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -1741,9 +1849,7 @@ class Users(client: Client) : Service(client) { } /** - * Update user status - * - * Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. + * Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. * * @param userId User ID. * @param status User Status. To activate the user pass `true` and to block the user pass `false`. @@ -1760,12 +1866,10 @@ class Users(client: Client) : Service(client) { ) /** - * List user targets - * * List the messaging targets that are associated with a user. * * @param userId User ID. - * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels + * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType * @return [io.appwrite.models.TargetList] */ @JvmOverloads @@ -1780,8 +1884,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.TargetList = { io.appwrite.models.TargetList.from(map = it as Map) @@ -1797,8 +1900,6 @@ class Users(client: Client) : Service(client) { } /** - * Create user target - * * Create a messaging target. * * @param userId User ID. @@ -1829,7 +1930,7 @@ class Users(client: Client) : Service(client) { "providerId" to providerId, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Target = { @@ -1846,9 +1947,7 @@ class Users(client: Client) : Service(client) { } /** - * Get user target - * - * Get a user's push notification target by ID. + * Get a user's push notification target by ID. * * @param userId User ID. * @param targetId Target ID. @@ -1865,8 +1964,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( - "content-type" to "application/json", + val apiHeaders = mutableMapOf( ) val converter: (Any) -> io.appwrite.models.Target = { io.appwrite.models.Target.from(map = it as Map) @@ -1882,8 +1980,6 @@ class Users(client: Client) : Service(client) { } /** - * Update user target - * * Update a messaging target. * * @param userId User ID. @@ -1911,7 +2007,7 @@ class Users(client: Client) : Service(client) { "providerId" to providerId, "name" to name, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Target = { @@ -1928,8 +2024,6 @@ class Users(client: Client) : Service(client) { } /** - * Delete user target - * * Delete a messaging target. * * @param userId User ID. @@ -1947,7 +2041,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) return client.call( @@ -1960,9 +2054,8 @@ class Users(client: Client) : Service(client) { } /** - * Create token - * * Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. + * * * @param userId User ID. * @param length Token length in characters. The default length is 6 characters @@ -1983,7 +2076,7 @@ class Users(client: Client) : Service(client) { "length" to length, "expire" to expire, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @@ -2000,8 +2093,6 @@ class Users(client: Client) : Service(client) { } /** - * Update email verification - * * Update the user email verification status by its unique ID. * * @param userId User ID. @@ -2020,7 +2111,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "emailVerification" to emailVerification, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -2037,8 +2128,6 @@ class Users(client: Client) : Service(client) { } /** - * Update email verification - * * Update the user email verification status by its unique ID. * * @param userId User ID. @@ -2056,8 +2145,6 @@ class Users(client: Client) : Service(client) { ) /** - * Update phone verification - * * Update the user phone verification status by its unique ID. * * @param userId User ID. @@ -2076,7 +2163,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "phoneVerification" to phoneVerification, ) - val apiHeaders = mutableMapOf( + val apiHeaders = mutableMapOf( "content-type" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @@ -2093,8 +2180,6 @@ class Users(client: Client) : Service(client) { } /** - * Update phone verification - * * Update the user phone verification status by its unique ID. * * @param userId User ID.