diff --git a/CHANGELOG.md b/CHANGELOG.md
index afd1c28..c2b36e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
# Change Log
+## 15.0.0
+
+* [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents
+* Breaking: Renamed `IndexType` to `DatabasesIndexType` in docs.
+* Breaking: Replaced `.setKey()` with `.setSession()` in docs examples.
+* Updated: Updated docs to reflect new `DatabasesIndexType` examples.
+
## 14.1.0
* Added getConsolePausing health status endpoint
diff --git a/README.md b/README.md
index fc72244..d60bd31 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,11 @@


-
+
[](https://twitter.com/appwrite)
[](https://appwrite.io/discord)
-**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 SDK is compatible with Appwrite server version 1.9.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:14.1.0")
+implementation("io.appwrite:sdk-for-kotlin:15.0.0")
```
### Maven
@@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
io.appwrite
sdk-for-kotlin
- 14.1.0
+ 15.0.0
```
diff --git a/docs/examples/java/databases/create-index.md b/docs/examples/java/databases/create-index.md
index 5dc2222..28a10ca 100644
--- a/docs/examples/java/databases/create-index.md
+++ b/docs/examples/java/databases/create-index.md
@@ -2,7 +2,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;
-import io.appwrite.enums.IndexType;
+import io.appwrite.enums.DatabasesIndexType;
import io.appwrite.enums.OrderBy;
Client client = new Client()
@@ -16,7 +16,7 @@ databases.createIndex(
"", // databaseId
"", // collectionId
"", // key
- IndexType.KEY, // type
+ DatabasesIndexType.KEY, // type
List.of(), // attributes
List.of(OrderBy.ASC), // orders (optional)
List.of(), // lengths (optional)
diff --git a/docs/examples/java/functions/create.md b/docs/examples/java/functions/create.md
index 47015f3..d423c66 100644
--- a/docs/examples/java/functions/create.md
+++ b/docs/examples/java/functions/create.md
@@ -30,7 +30,9 @@ functions.create(
"", // providerBranch (optional)
false, // providerSilentMode (optional)
"", // providerRootDirectory (optional)
- "", // specification (optional)
+ "", // buildSpecification (optional)
+ "", // runtimeSpecification (optional)
+ 0, // deploymentRetention (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 7ab2402..5e7b5c8 100644
--- a/docs/examples/java/functions/update.md
+++ b/docs/examples/java/functions/update.md
@@ -30,7 +30,9 @@ functions.update(
"", // providerBranch (optional)
false, // providerSilentMode (optional)
"", // providerRootDirectory (optional)
- "", // specification (optional)
+ "", // buildSpecification (optional)
+ "", // runtimeSpecification (optional)
+ 0, // deploymentRetention (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/project/create-variable.md b/docs/examples/java/project/create-variable.md
new file mode 100644
index 0000000..62d7a47
--- /dev/null
+++ b/docs/examples/java/project/create-variable.md
@@ -0,0 +1,28 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Project;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Project project = new Project(client);
+
+project.createVariable(
+ "", // variableId
+ "", // 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/project/delete-variable.md b/docs/examples/java/project/delete-variable.md
new file mode 100644
index 0000000..98ff61d
--- /dev/null
+++ b/docs/examples/java/project/delete-variable.md
@@ -0,0 +1,25 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Project;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Project project = new Project(client);
+
+project.deleteVariable(
+ "", // variableId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/project/get-variable.md b/docs/examples/java/project/get-variable.md
new file mode 100644
index 0000000..f922e27
--- /dev/null
+++ b/docs/examples/java/project/get-variable.md
@@ -0,0 +1,25 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Project;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Project project = new Project(client);
+
+project.getVariable(
+ "", // variableId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/project/list-variables.md b/docs/examples/java/project/list-variables.md
new file mode 100644
index 0000000..bfcfbd6
--- /dev/null
+++ b/docs/examples/java/project/list-variables.md
@@ -0,0 +1,26 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Project;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Project project = new Project(client);
+
+project.listVariables(
+ List.of(), // queries (optional)
+ false, // total (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/project/update-variable.md b/docs/examples/java/project/update-variable.md
new file mode 100644
index 0000000..19e7d88
--- /dev/null
+++ b/docs/examples/java/project/update-variable.md
@@ -0,0 +1,28 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Project;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Project project = new Project(client);
+
+project.updateVariable(
+ "", // variableId
+ "", // key (optional)
+ "", // 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/create.md b/docs/examples/java/sites/create.md
index 328b395..1f1f8e3 100644
--- a/docs/examples/java/sites/create.md
+++ b/docs/examples/java/sites/create.md
@@ -23,6 +23,7 @@ sites.create(
1, // timeout (optional)
"", // installCommand (optional)
"", // buildCommand (optional)
+ "", // startCommand (optional)
"", // outputDirectory (optional)
Adapter.STATIC, // adapter (optional)
"", // installationId (optional)
@@ -31,7 +32,9 @@ sites.create(
"", // providerBranch (optional)
false, // providerSilentMode (optional)
"", // providerRootDirectory (optional)
- "", // specification (optional)
+ "", // buildSpecification (optional)
+ "", // runtimeSpecification (optional)
+ 0, // deploymentRetention (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/sites/update.md b/docs/examples/java/sites/update.md
index 6f34a38..5086605 100644
--- a/docs/examples/java/sites/update.md
+++ b/docs/examples/java/sites/update.md
@@ -22,6 +22,7 @@ sites.update(
1, // timeout (optional)
"", // installCommand (optional)
"", // buildCommand (optional)
+ "", // startCommand (optional)
"", // outputDirectory (optional)
BuildRuntime.NODE_14_5, // buildRuntime (optional)
Adapter.STATIC, // adapter (optional)
@@ -31,7 +32,9 @@ sites.update(
"", // providerBranch (optional)
false, // providerSilentMode (optional)
"", // providerRootDirectory (optional)
- "", // specification (optional)
+ "", // buildSpecification (optional)
+ "", // runtimeSpecification (optional)
+ 0, // deploymentRetention (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/create-index.md b/docs/examples/java/tablesdb/create-index.md
index 0ad4055..17b6e1d 100644
--- a/docs/examples/java/tablesdb/create-index.md
+++ b/docs/examples/java/tablesdb/create-index.md
@@ -2,7 +2,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDB;
-import io.appwrite.enums.IndexType;
+import io.appwrite.enums.TablesDBIndexType;
import io.appwrite.enums.OrderBy;
Client client = new Client()
@@ -16,7 +16,7 @@ tablesDB.createIndex(
"", // databaseId
"", // tableId
"", // key
- IndexType.KEY, // type
+ TablesDBIndexType.KEY, // type
List.of(), // columns
List.of(OrderBy.ASC), // orders (optional)
List.of(), // lengths (optional)
diff --git a/docs/examples/java/users/update-impersonator.md b/docs/examples/java/users/update-impersonator.md
new file mode 100644
index 0000000..879e436
--- /dev/null
+++ b/docs/examples/java/users/update-impersonator.md
@@ -0,0 +1,26 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Users;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Users users = new Users(client);
+
+users.updateImpersonator(
+ "", // userId
+ false, // impersonator
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/webhooks/create.md b/docs/examples/java/webhooks/create.md
new file mode 100644
index 0000000..22a856e
--- /dev/null
+++ b/docs/examples/java/webhooks/create.md
@@ -0,0 +1,32 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Webhooks;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Webhooks webhooks = new Webhooks(client);
+
+webhooks.create(
+ "", // webhookId
+ "", // url
+ "", // name
+ List.of(), // events
+ false, // enabled (optional)
+ false, // security (optional)
+ "", // httpUser (optional)
+ "", // httpPass (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/webhooks/delete.md b/docs/examples/java/webhooks/delete.md
new file mode 100644
index 0000000..21c5304
--- /dev/null
+++ b/docs/examples/java/webhooks/delete.md
@@ -0,0 +1,25 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Webhooks;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Webhooks webhooks = new Webhooks(client);
+
+webhooks.delete(
+ "", // webhookId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/webhooks/get.md b/docs/examples/java/webhooks/get.md
new file mode 100644
index 0000000..07ed771
--- /dev/null
+++ b/docs/examples/java/webhooks/get.md
@@ -0,0 +1,25 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Webhooks;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Webhooks webhooks = new Webhooks(client);
+
+webhooks.get(
+ "", // webhookId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/webhooks/list.md b/docs/examples/java/webhooks/list.md
new file mode 100644
index 0000000..22e3d32
--- /dev/null
+++ b/docs/examples/java/webhooks/list.md
@@ -0,0 +1,26 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Webhooks;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Webhooks webhooks = new Webhooks(client);
+
+webhooks.list(
+ List.of(), // queries (optional)
+ false, // total (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/webhooks/update-signature.md b/docs/examples/java/webhooks/update-signature.md
new file mode 100644
index 0000000..2526dd5
--- /dev/null
+++ b/docs/examples/java/webhooks/update-signature.md
@@ -0,0 +1,25 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Webhooks;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Webhooks webhooks = new Webhooks(client);
+
+webhooks.updateSignature(
+ "", // webhookId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/java/webhooks/update.md b/docs/examples/java/webhooks/update.md
new file mode 100644
index 0000000..cb7cf9b
--- /dev/null
+++ b/docs/examples/java/webhooks/update.md
@@ -0,0 +1,32 @@
+```java
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Webhooks;
+
+Client client = new Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey(""); // Your secret API key
+
+Webhooks webhooks = new Webhooks(client);
+
+webhooks.update(
+ "", // webhookId
+ "", // name
+ "", // url
+ List.of(), // events
+ false, // enabled (optional)
+ false, // security (optional)
+ "", // httpUser (optional)
+ "", // httpPass (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ System.out.println(result);
+ })
+);
+
+```
diff --git a/docs/examples/kotlin/databases/create-index.md b/docs/examples/kotlin/databases/create-index.md
index 85d3729..aae520e 100644
--- a/docs/examples/kotlin/databases/create-index.md
+++ b/docs/examples/kotlin/databases/create-index.md
@@ -2,7 +2,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Databases
-import io.appwrite.enums.IndexType
+import io.appwrite.enums.DatabasesIndexType
import io.appwrite.enums.OrderBy
val client = Client()
@@ -16,7 +16,7 @@ val response = databases.createIndex(
databaseId = "",
collectionId = "",
key = "",
- type = IndexType.KEY,
+ type = DatabasesIndexType.KEY,
attributes = listOf(),
orders = listOf(OrderBy.ASC), // optional
lengths = listOf() // optional
diff --git a/docs/examples/kotlin/functions/create.md b/docs/examples/kotlin/functions/create.md
index 0ad7f97..ce62e40 100644
--- a/docs/examples/kotlin/functions/create.md
+++ b/docs/examples/kotlin/functions/create.md
@@ -30,6 +30,8 @@ val response = functions.create(
providerBranch = "", // optional
providerSilentMode = false, // optional
providerRootDirectory = "", // optional
- specification = "" // optional
+ buildSpecification = "", // optional
+ runtimeSpecification = "", // optional
+ deploymentRetention = 0 // optional
)
```
diff --git a/docs/examples/kotlin/functions/update.md b/docs/examples/kotlin/functions/update.md
index c04a3c9..a686091 100644
--- a/docs/examples/kotlin/functions/update.md
+++ b/docs/examples/kotlin/functions/update.md
@@ -30,6 +30,8 @@ val response = functions.update(
providerBranch = "", // optional
providerSilentMode = false, // optional
providerRootDirectory = "", // optional
- specification = "" // optional
+ buildSpecification = "", // optional
+ runtimeSpecification = "", // optional
+ deploymentRetention = 0 // optional
)
```
diff --git a/docs/examples/kotlin/project/create-variable.md b/docs/examples/kotlin/project/create-variable.md
new file mode 100644
index 0000000..e61e1ba
--- /dev/null
+++ b/docs/examples/kotlin/project/create-variable.md
@@ -0,0 +1,19 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Project
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val project = Project(client)
+
+val response = project.createVariable(
+ variableId = "",
+ key = "",
+ value = "",
+ secret = false // optional
+)
+```
diff --git a/docs/examples/kotlin/project/delete-variable.md b/docs/examples/kotlin/project/delete-variable.md
new file mode 100644
index 0000000..674d805
--- /dev/null
+++ b/docs/examples/kotlin/project/delete-variable.md
@@ -0,0 +1,16 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Project
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val project = Project(client)
+
+val response = project.deleteVariable(
+ variableId = ""
+)
+```
diff --git a/docs/examples/kotlin/project/get-variable.md b/docs/examples/kotlin/project/get-variable.md
new file mode 100644
index 0000000..59dea64
--- /dev/null
+++ b/docs/examples/kotlin/project/get-variable.md
@@ -0,0 +1,16 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Project
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val project = Project(client)
+
+val response = project.getVariable(
+ variableId = ""
+)
+```
diff --git a/docs/examples/kotlin/project/list-variables.md b/docs/examples/kotlin/project/list-variables.md
new file mode 100644
index 0000000..d455a15
--- /dev/null
+++ b/docs/examples/kotlin/project/list-variables.md
@@ -0,0 +1,17 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Project
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val project = Project(client)
+
+val response = project.listVariables(
+ queries = listOf(), // optional
+ total = false // optional
+)
+```
diff --git a/docs/examples/kotlin/project/update-variable.md b/docs/examples/kotlin/project/update-variable.md
new file mode 100644
index 0000000..cc6b22e
--- /dev/null
+++ b/docs/examples/kotlin/project/update-variable.md
@@ -0,0 +1,19 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Project
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val project = Project(client)
+
+val response = project.updateVariable(
+ variableId = "",
+ key = "", // optional
+ value = "", // optional
+ secret = false // optional
+)
+```
diff --git a/docs/examples/kotlin/sites/create.md b/docs/examples/kotlin/sites/create.md
index a0a0205..9bc8982 100644
--- a/docs/examples/kotlin/sites/create.md
+++ b/docs/examples/kotlin/sites/create.md
@@ -23,6 +23,7 @@ val response = sites.create(
timeout = 1, // optional
installCommand = "", // optional
buildCommand = "", // optional
+ startCommand = "", // optional
outputDirectory = "", // optional
adapter = Adapter.STATIC, // optional
installationId = "", // optional
@@ -31,6 +32,8 @@ val response = sites.create(
providerBranch = "", // optional
providerSilentMode = false, // optional
providerRootDirectory = "", // optional
- specification = "" // optional
+ buildSpecification = "", // optional
+ runtimeSpecification = "", // optional
+ deploymentRetention = 0 // optional
)
```
diff --git a/docs/examples/kotlin/sites/update.md b/docs/examples/kotlin/sites/update.md
index e3b1ecb..63ff5b0 100644
--- a/docs/examples/kotlin/sites/update.md
+++ b/docs/examples/kotlin/sites/update.md
@@ -22,6 +22,7 @@ val response = sites.update(
timeout = 1, // optional
installCommand = "", // optional
buildCommand = "", // optional
+ startCommand = "", // optional
outputDirectory = "", // optional
buildRuntime = BuildRuntime.NODE_14_5, // optional
adapter = Adapter.STATIC, // optional
@@ -31,6 +32,8 @@ val response = sites.update(
providerBranch = "", // optional
providerSilentMode = false, // optional
providerRootDirectory = "", // optional
- specification = "" // optional
+ buildSpecification = "", // optional
+ runtimeSpecification = "", // optional
+ deploymentRetention = 0 // optional
)
```
diff --git a/docs/examples/kotlin/tablesdb/create-index.md b/docs/examples/kotlin/tablesdb/create-index.md
index b3c09ee..021290d 100644
--- a/docs/examples/kotlin/tablesdb/create-index.md
+++ b/docs/examples/kotlin/tablesdb/create-index.md
@@ -2,7 +2,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.TablesDB
-import io.appwrite.enums.IndexType
+import io.appwrite.enums.TablesDBIndexType
import io.appwrite.enums.OrderBy
val client = Client()
@@ -16,7 +16,7 @@ val response = tablesDB.createIndex(
databaseId = "",
tableId = "",
key = "",
- type = IndexType.KEY,
+ type = TablesDBIndexType.KEY,
columns = listOf(),
orders = listOf(OrderBy.ASC), // optional
lengths = listOf() // optional
diff --git a/docs/examples/kotlin/users/update-impersonator.md b/docs/examples/kotlin/users/update-impersonator.md
new file mode 100644
index 0000000..58a8e6e
--- /dev/null
+++ b/docs/examples/kotlin/users/update-impersonator.md
@@ -0,0 +1,17 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Users
+
+val client = Client()
+ .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.updateImpersonator(
+ userId = "",
+ impersonator = false
+)
+```
diff --git a/docs/examples/kotlin/webhooks/create.md b/docs/examples/kotlin/webhooks/create.md
new file mode 100644
index 0000000..d5eaedd
--- /dev/null
+++ b/docs/examples/kotlin/webhooks/create.md
@@ -0,0 +1,23 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Webhooks
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val webhooks = Webhooks(client)
+
+val response = webhooks.create(
+ webhookId = "",
+ url = "",
+ name = "",
+ events = listOf(),
+ enabled = false, // optional
+ security = false, // optional
+ httpUser = "", // optional
+ httpPass = "" // optional
+)
+```
diff --git a/docs/examples/kotlin/webhooks/delete.md b/docs/examples/kotlin/webhooks/delete.md
new file mode 100644
index 0000000..6f381c2
--- /dev/null
+++ b/docs/examples/kotlin/webhooks/delete.md
@@ -0,0 +1,16 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Webhooks
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val webhooks = Webhooks(client)
+
+val response = webhooks.delete(
+ webhookId = ""
+)
+```
diff --git a/docs/examples/kotlin/webhooks/get.md b/docs/examples/kotlin/webhooks/get.md
new file mode 100644
index 0000000..1f82c0b
--- /dev/null
+++ b/docs/examples/kotlin/webhooks/get.md
@@ -0,0 +1,16 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Webhooks
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val webhooks = Webhooks(client)
+
+val response = webhooks.get(
+ webhookId = ""
+)
+```
diff --git a/docs/examples/kotlin/webhooks/list.md b/docs/examples/kotlin/webhooks/list.md
new file mode 100644
index 0000000..f3f9f23
--- /dev/null
+++ b/docs/examples/kotlin/webhooks/list.md
@@ -0,0 +1,17 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Webhooks
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val webhooks = Webhooks(client)
+
+val response = webhooks.list(
+ queries = listOf(), // optional
+ total = false // optional
+)
+```
diff --git a/docs/examples/kotlin/webhooks/update-signature.md b/docs/examples/kotlin/webhooks/update-signature.md
new file mode 100644
index 0000000..d58f9ef
--- /dev/null
+++ b/docs/examples/kotlin/webhooks/update-signature.md
@@ -0,0 +1,16 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Webhooks
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val webhooks = Webhooks(client)
+
+val response = webhooks.updateSignature(
+ webhookId = ""
+)
+```
diff --git a/docs/examples/kotlin/webhooks/update.md b/docs/examples/kotlin/webhooks/update.md
new file mode 100644
index 0000000..06e7d31
--- /dev/null
+++ b/docs/examples/kotlin/webhooks/update.md
@@ -0,0 +1,23 @@
+```kotlin
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Webhooks
+
+val client = Client()
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+ .setKey("") // Your secret API key
+
+val webhooks = Webhooks(client)
+
+val response = webhooks.update(
+ webhookId = "",
+ name = "",
+ url = "",
+ events = listOf(),
+ enabled = false, // optional
+ security = false, // optional
+ httpUser = "", // optional
+ httpPass = "" // optional
+)
+```
diff --git a/src/main/kotlin/io/appwrite/Client.kt b/src/main/kotlin/io/appwrite/Client.kt
index 18232f2..0fd7889 100644
--- a/src/main/kotlin/io/appwrite/Client.kt
+++ b/src/main/kotlin/io/appwrite/Client.kt
@@ -57,12 +57,12 @@ class Client @JvmOverloads constructor(
init {
headers = mutableMapOf(
"content-type" to "application/json",
- "user-agent" to "AppwriteKotlinSDK/14.1.0 ${System.getProperty("http.agent")}",
+ "user-agent" to "AppwriteKotlinSDK/15.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 "14.1.0",
- "x-appwrite-response-format" to "1.8.0",
+ "x-sdk-version" to "15.0.0",
+ "x-appwrite-response-format" to "1.9.0",
)
config = mutableMapOf()
@@ -158,6 +158,51 @@ class Client @JvmOverloads constructor(
return this
}
+ /**
+ * Set ImpersonateUserId
+ *
+ * Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.
+ *
+ * @param {string} impersonateuserid
+ *
+ * @return this
+ */
+ fun setImpersonateUserId(value: String): Client {
+ config["impersonateUserId"] = value
+ addHeader("x-appwrite-impersonate-user-id", value)
+ return this
+ }
+
+ /**
+ * Set ImpersonateUserEmail
+ *
+ * Impersonate a user by email on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.
+ *
+ * @param {string} impersonateuseremail
+ *
+ * @return this
+ */
+ fun setImpersonateUserEmail(value: String): Client {
+ config["impersonateUserEmail"] = value
+ addHeader("x-appwrite-impersonate-user-email", value)
+ return this
+ }
+
+ /**
+ * Set ImpersonateUserPhone
+ *
+ * Impersonate a user by phone on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data.
+ *
+ * @param {string} impersonateuserphone
+ *
+ * @return this
+ */
+ fun setImpersonateUserPhone(value: String): Client {
+ config["impersonateUserPhone"] = value
+ addHeader("x-appwrite-impersonate-user-phone", value)
+ return this
+ }
+
/**
* Set self Signed
*
diff --git a/src/main/kotlin/io/appwrite/enums/BackupServices.kt b/src/main/kotlin/io/appwrite/enums/BackupServices.kt
index e82c017..3cadb7e 100644
--- a/src/main/kotlin/io/appwrite/enums/BackupServices.kt
+++ b/src/main/kotlin/io/appwrite/enums/BackupServices.kt
@@ -5,6 +5,12 @@ import com.google.gson.annotations.SerializedName
enum class BackupServices(val value: String) {
@SerializedName("databases")
DATABASES("databases"),
+ @SerializedName("tablesdb")
+ TABLESDB("tablesdb"),
+ @SerializedName("documentsdb")
+ DOCUMENTSDB("documentsdb"),
+ @SerializedName("vectorsdb")
+ VECTORSDB("vectorsdb"),
@SerializedName("functions")
FUNCTIONS("functions"),
@SerializedName("storage")
diff --git a/src/main/kotlin/io/appwrite/enums/DatabaseType.kt b/src/main/kotlin/io/appwrite/enums/DatabaseType.kt
index 8aeb0f4..f2dfc31 100644
--- a/src/main/kotlin/io/appwrite/enums/DatabaseType.kt
+++ b/src/main/kotlin/io/appwrite/enums/DatabaseType.kt
@@ -6,7 +6,11 @@ enum class DatabaseType(val value: String) {
@SerializedName("legacy")
LEGACY("legacy"),
@SerializedName("tablesdb")
- TABLESDB("tablesdb");
+ TABLESDB("tablesdb"),
+ @SerializedName("documentsdb")
+ DOCUMENTSDB("documentsdb"),
+ @SerializedName("vectorsdb")
+ VECTORSDB("vectorsdb");
override fun toString() = value
}
\ No newline at end of file
diff --git a/src/main/kotlin/io/appwrite/enums/DatabasesIndexType.kt b/src/main/kotlin/io/appwrite/enums/DatabasesIndexType.kt
new file mode 100644
index 0000000..491eec4
--- /dev/null
+++ b/src/main/kotlin/io/appwrite/enums/DatabasesIndexType.kt
@@ -0,0 +1,16 @@
+package io.appwrite.enums
+
+import com.google.gson.annotations.SerializedName
+
+enum class DatabasesIndexType(val value: String) {
+ @SerializedName("key")
+ KEY("key"),
+ @SerializedName("fulltext")
+ FULLTEXT("fulltext"),
+ @SerializedName("unique")
+ UNIQUE("unique"),
+ @SerializedName("spatial")
+ SPATIAL("spatial");
+
+ override fun toString() = value
+}
\ No newline at end of file
diff --git a/src/main/kotlin/io/appwrite/enums/Scopes.kt b/src/main/kotlin/io/appwrite/enums/Scopes.kt
index 1b77212..0dcf844 100644
--- a/src/main/kotlin/io/appwrite/enums/Scopes.kt
+++ b/src/main/kotlin/io/appwrite/enums/Scopes.kt
@@ -117,6 +117,14 @@ enum class Scopes(val value: String) {
TOKENS_READ("tokens.read"),
@SerializedName("tokens.write")
TOKENS_WRITE("tokens.write"),
+ @SerializedName("webhooks.read")
+ WEBHOOKS_READ("webhooks.read"),
+ @SerializedName("webhooks.write")
+ WEBHOOKS_WRITE("webhooks.write"),
+ @SerializedName("project.read")
+ PROJECT_READ("project.read"),
+ @SerializedName("project.write")
+ PROJECT_WRITE("project.write"),
@SerializedName("policies.write")
POLICIES_WRITE("policies.write"),
@SerializedName("policies.read")
diff --git a/src/main/kotlin/io/appwrite/enums/IndexType.kt b/src/main/kotlin/io/appwrite/enums/TablesDBIndexType.kt
similarity index 86%
rename from src/main/kotlin/io/appwrite/enums/IndexType.kt
rename to src/main/kotlin/io/appwrite/enums/TablesDBIndexType.kt
index eeebc06..452fe9d 100644
--- a/src/main/kotlin/io/appwrite/enums/IndexType.kt
+++ b/src/main/kotlin/io/appwrite/enums/TablesDBIndexType.kt
@@ -2,7 +2,7 @@ package io.appwrite.enums
import com.google.gson.annotations.SerializedName
-enum class IndexType(val value: String) {
+enum class TablesDBIndexType(val value: String) {
@SerializedName("key")
KEY("key"),
@SerializedName("fulltext")
diff --git a/src/main/kotlin/io/appwrite/enums/TemplateReferenceType.kt b/src/main/kotlin/io/appwrite/enums/TemplateReferenceType.kt
index 1f258b7..2997c18 100644
--- a/src/main/kotlin/io/appwrite/enums/TemplateReferenceType.kt
+++ b/src/main/kotlin/io/appwrite/enums/TemplateReferenceType.kt
@@ -3,10 +3,10 @@ package io.appwrite.enums
import com.google.gson.annotations.SerializedName
enum class TemplateReferenceType(val value: String) {
- @SerializedName("branch")
- BRANCH("branch"),
@SerializedName("commit")
COMMIT("commit"),
+ @SerializedName("branch")
+ BRANCH("branch"),
@SerializedName("tag")
TAG("tag");
diff --git a/src/main/kotlin/io/appwrite/models/Document.kt b/src/main/kotlin/io/appwrite/models/Document.kt
index 830fe38..c55e6d2 100644
--- a/src/main/kotlin/io/appwrite/models/Document.kt
+++ b/src/main/kotlin/io/appwrite/models/Document.kt
@@ -17,7 +17,7 @@ data class Document(
* Document sequence ID.
*/
@SerializedName("\$sequence")
- val sequence: Long,
+ val sequence: String,
/**
* Collection ID.
@@ -69,7 +69,7 @@ data class Document(
companion object {
operator fun invoke(
id: String,
- sequence: Long,
+ sequence: String,
collectionId: String,
databaseId: String,
createdAt: String,
@@ -93,7 +93,7 @@ data class Document(
nestedType: Class
) = Document(
id = map["\$id"] as String,
- sequence = (map["\$sequence"] as Number).toLong(),
+ sequence = map["\$sequence"] as String,
collectionId = map["\$collectionId"] as String,
databaseId = map["\$databaseId"] as String,
createdAt = map["\$createdAt"] as String,
diff --git a/src/main/kotlin/io/appwrite/models/Function.kt b/src/main/kotlin/io/appwrite/models/Function.kt
index 6cc111f..566c58d 100644
--- a/src/main/kotlin/io/appwrite/models/Function.kt
+++ b/src/main/kotlin/io/appwrite/models/Function.kt
@@ -61,6 +61,12 @@ data class Function(
@SerializedName("runtime")
val runtime: String,
+ /**
+ * How many days to keep the non-active deployments before they will be automatically deleted.
+ */
+ @SerializedName("deploymentRetention")
+ val deploymentRetention: Long,
+
/**
* Function's active deployment ID.
*/
@@ -170,10 +176,16 @@ data class Function(
val providerSilentMode: Boolean,
/**
- * Machine specification for builds and executions.
+ * Machine specification for deployment builds.
*/
- @SerializedName("specification")
- val specification: String,
+ @SerializedName("buildSpecification")
+ val buildSpecification: String,
+
+ /**
+ * Machine specification for executions.
+ */
+ @SerializedName("runtimeSpecification")
+ val runtimeSpecification: String,
) {
fun toMap(): Map = mapOf(
@@ -186,6 +198,7 @@ data class Function(
"live" to live as Any,
"logging" to logging as Any,
"runtime" to runtime as Any,
+ "deploymentRetention" to deploymentRetention as Any,
"deploymentId" to deploymentId as Any,
"deploymentCreatedAt" to deploymentCreatedAt as Any,
"latestDeploymentId" to latestDeploymentId as Any,
@@ -204,7 +217,8 @@ data class Function(
"providerBranch" to providerBranch as Any,
"providerRootDirectory" to providerRootDirectory as Any,
"providerSilentMode" to providerSilentMode as Any,
- "specification" to specification as Any,
+ "buildSpecification" to buildSpecification as Any,
+ "runtimeSpecification" to runtimeSpecification as Any,
)
companion object {
@@ -222,6 +236,7 @@ data class Function(
live = map["live"] as Boolean,
logging = map["logging"] as Boolean,
runtime = map["runtime"] as String,
+ deploymentRetention = (map["deploymentRetention"] as Number).toLong(),
deploymentId = map["deploymentId"] as String,
deploymentCreatedAt = map["deploymentCreatedAt"] as String,
latestDeploymentId = map["latestDeploymentId"] as String,
@@ -240,7 +255,8 @@ data class Function(
providerBranch = map["providerBranch"] as String,
providerRootDirectory = map["providerRootDirectory"] as String,
providerSilentMode = map["providerSilentMode"] as Boolean,
- specification = map["specification"] as String,
+ buildSpecification = map["buildSpecification"] as String,
+ runtimeSpecification = map["runtimeSpecification"] as String,
)
}
}
\ No newline at end of file
diff --git a/src/main/kotlin/io/appwrite/models/Log.kt b/src/main/kotlin/io/appwrite/models/Log.kt
index c2df960..fe8c60b 100644
--- a/src/main/kotlin/io/appwrite/models/Log.kt
+++ b/src/main/kotlin/io/appwrite/models/Log.kt
@@ -14,19 +14,19 @@ data class Log(
val event: String,
/**
- * User ID.
+ * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user.
*/
@SerializedName("userId")
val userId: String,
/**
- * User Email.
+ * User email of the actor recorded for this log. During impersonation, this is the original impersonator.
*/
@SerializedName("userEmail")
val userEmail: String,
/**
- * User Name.
+ * User name of the actor recorded for this log. During impersonation, this is the original impersonator.
*/
@SerializedName("userName")
val userName: String,
diff --git a/src/main/kotlin/io/appwrite/models/Row.kt b/src/main/kotlin/io/appwrite/models/Row.kt
index 793d278..488ec7b 100644
--- a/src/main/kotlin/io/appwrite/models/Row.kt
+++ b/src/main/kotlin/io/appwrite/models/Row.kt
@@ -17,7 +17,7 @@ data class Row(
* Row sequence ID.
*/
@SerializedName("\$sequence")
- val sequence: Long,
+ val sequence: String,
/**
* Table ID.
@@ -69,7 +69,7 @@ data class Row(
companion object {
operator fun invoke(
id: String,
- sequence: Long,
+ sequence: String,
tableId: String,
databaseId: String,
createdAt: String,
@@ -93,7 +93,7 @@ data class Row(
nestedType: Class
) = Row(
id = map["\$id"] as String,
- sequence = (map["\$sequence"] as Number).toLong(),
+ sequence = map["\$sequence"] as String,
tableId = map["\$tableId"] as String,
databaseId = map["\$databaseId"] as String,
createdAt = map["\$createdAt"] as String,
diff --git a/src/main/kotlin/io/appwrite/models/Site.kt b/src/main/kotlin/io/appwrite/models/Site.kt
index c246ac1..0359543 100644
--- a/src/main/kotlin/io/appwrite/models/Site.kt
+++ b/src/main/kotlin/io/appwrite/models/Site.kt
@@ -55,6 +55,12 @@ data class Site(
@SerializedName("framework")
val framework: String,
+ /**
+ * How many days to keep the non-active deployments before they will be automatically deleted.
+ */
+ @SerializedName("deploymentRetention")
+ val deploymentRetention: Long,
+
/**
* Site's active deployment ID.
*/
@@ -121,6 +127,12 @@ data class Site(
@SerializedName("buildCommand")
val buildCommand: String,
+ /**
+ * Custom command to use when starting site runtime.
+ */
+ @SerializedName("startCommand")
+ val startCommand: String,
+
/**
* The directory where the site build output is located.
*/
@@ -158,10 +170,16 @@ data class Site(
val providerSilentMode: Boolean,
/**
- * Machine specification for builds and executions.
+ * Machine specification for deployment builds.
*/
- @SerializedName("specification")
- val specification: String,
+ @SerializedName("buildSpecification")
+ val buildSpecification: String,
+
+ /**
+ * Machine specification for SSR executions.
+ */
+ @SerializedName("runtimeSpecification")
+ val runtimeSpecification: String,
/**
* Site build runtime.
@@ -191,6 +209,7 @@ data class Site(
"live" to live as Any,
"logging" to logging as Any,
"framework" to framework as Any,
+ "deploymentRetention" to deploymentRetention as Any,
"deploymentId" to deploymentId as Any,
"deploymentCreatedAt" to deploymentCreatedAt as Any,
"deploymentScreenshotLight" to deploymentScreenshotLight as Any,
@@ -202,13 +221,15 @@ data class Site(
"timeout" to timeout as Any,
"installCommand" to installCommand as Any,
"buildCommand" to buildCommand as Any,
+ "startCommand" to startCommand 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,
+ "buildSpecification" to buildSpecification as Any,
+ "runtimeSpecification" to runtimeSpecification as Any,
"buildRuntime" to buildRuntime as Any,
"adapter" to adapter as Any,
"fallbackFile" to fallbackFile as Any,
@@ -228,6 +249,7 @@ data class Site(
live = map["live"] as Boolean,
logging = map["logging"] as Boolean,
framework = map["framework"] as String,
+ deploymentRetention = (map["deploymentRetention"] as Number).toLong(),
deploymentId = map["deploymentId"] as String,
deploymentCreatedAt = map["deploymentCreatedAt"] as String,
deploymentScreenshotLight = map["deploymentScreenshotLight"] as String,
@@ -239,13 +261,15 @@ data class Site(
timeout = (map["timeout"] as Number).toLong(),
installCommand = map["installCommand"] as String,
buildCommand = map["buildCommand"] as String,
+ startCommand = map["startCommand"] 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,
+ buildSpecification = map["buildSpecification"] as String,
+ runtimeSpecification = map["runtimeSpecification"] as String,
buildRuntime = map["buildRuntime"] as String,
adapter = map["adapter"] as String,
fallbackFile = map["fallbackFile"] as String,
diff --git a/src/main/kotlin/io/appwrite/models/User.kt b/src/main/kotlin/io/appwrite/models/User.kt
index e9a1144..a76d61f 100644
--- a/src/main/kotlin/io/appwrite/models/User.kt
+++ b/src/main/kotlin/io/appwrite/models/User.kt
@@ -121,6 +121,18 @@ data class User(
@SerializedName("accessedAt")
val accessedAt: String,
+ /**
+ * Whether the user can impersonate other users.
+ */
+ @SerializedName("impersonator")
+ var impersonator: Boolean?,
+
+ /**
+ * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data.
+ */
+ @SerializedName("impersonatorUserId")
+ var impersonatorUserId: String?,
+
) {
fun toMap(): Map = mapOf(
"\$id" to id as Any,
@@ -142,6 +154,8 @@ data class User(
"prefs" to prefs.toMap() as Any,
"targets" to targets.map { it.toMap() } as Any,
"accessedAt" to accessedAt as Any,
+ "impersonator" to impersonator as Any,
+ "impersonatorUserId" to impersonatorUserId as Any,
)
companion object {
@@ -165,6 +179,8 @@ data class User(
prefs: Preferences