Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.1-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.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.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)

Expand Down Expand Up @@ -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
Expand All @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-kotlin</artifactId>
<version>14.1.0</version>
<version>15.0.0</version>
</dependency>
</dependencies>
```
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/databases/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -16,7 +16,7 @@ databases.createIndex(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"", // key
IndexType.KEY, // type
DatabasesIndexType.KEY, // type
List.of(), // attributes
List.of(OrderBy.ASC), // orders (optional)
List.of(), // lengths (optional)
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/java/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ functions.create(
"<PROVIDER_BRANCH>", // providerBranch (optional)
false, // providerSilentMode (optional)
"<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional)
"", // specification (optional)
"", // buildSpecification (optional)
"", // runtimeSpecification (optional)
0, // deploymentRetention (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/java/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ functions.update(
"<PROVIDER_BRANCH>", // providerBranch (optional)
false, // providerSilentMode (optional)
"<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional)
"", // specification (optional)
"", // buildSpecification (optional)
"", // runtimeSpecification (optional)
0, // deploymentRetention (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
28 changes: 28 additions & 0 deletions docs/examples/java/project/create-variable.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Project project = new Project(client);

project.createVariable(
"<VARIABLE_ID>", // variableId
"<KEY>", // key
"<VALUE>", // value
false, // secret (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

```
25 changes: 25 additions & 0 deletions docs/examples/java/project/delete-variable.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Project project = new Project(client);

project.deleteVariable(
"<VARIABLE_ID>", // variableId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

```
25 changes: 25 additions & 0 deletions docs/examples/java/project/get-variable.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Project project = new Project(client);

project.getVariable(
"<VARIABLE_ID>", // variableId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

```
26 changes: 26 additions & 0 deletions docs/examples/java/project/list-variables.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // 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);
})
);

```
28 changes: 28 additions & 0 deletions docs/examples/java/project/update-variable.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Project project = new Project(client);

project.updateVariable(
"<VARIABLE_ID>", // variableId
"<KEY>", // key (optional)
"<VALUE>", // value (optional)
false, // secret (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

```
5 changes: 4 additions & 1 deletion docs/examples/java/sites/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ sites.create(
1, // timeout (optional)
"<INSTALL_COMMAND>", // installCommand (optional)
"<BUILD_COMMAND>", // buildCommand (optional)
"<START_COMMAND>", // startCommand (optional)
"<OUTPUT_DIRECTORY>", // outputDirectory (optional)
Adapter.STATIC, // adapter (optional)
"<INSTALLATION_ID>", // installationId (optional)
Expand All @@ -31,7 +32,9 @@ sites.create(
"<PROVIDER_BRANCH>", // providerBranch (optional)
false, // providerSilentMode (optional)
"<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional)
"", // specification (optional)
"", // buildSpecification (optional)
"", // runtimeSpecification (optional)
0, // deploymentRetention (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
5 changes: 4 additions & 1 deletion docs/examples/java/sites/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ sites.update(
1, // timeout (optional)
"<INSTALL_COMMAND>", // installCommand (optional)
"<BUILD_COMMAND>", // buildCommand (optional)
"<START_COMMAND>", // startCommand (optional)
"<OUTPUT_DIRECTORY>", // outputDirectory (optional)
BuildRuntime.NODE_14_5, // buildRuntime (optional)
Adapter.STATIC, // adapter (optional)
Expand All @@ -31,7 +32,9 @@ sites.update(
"<PROVIDER_BRANCH>", // providerBranch (optional)
false, // providerSilentMode (optional)
"<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional)
"", // specification (optional)
"", // buildSpecification (optional)
"", // runtimeSpecification (optional)
0, // deploymentRetention (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/tablesdb/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -16,7 +16,7 @@ tablesDB.createIndex(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"", // key
IndexType.KEY, // type
TablesDBIndexType.KEY, // type
List.of(), // columns
List.of(OrderBy.ASC), // orders (optional)
List.of(), // lengths (optional)
Expand Down
26 changes: 26 additions & 0 deletions docs/examples/java/users/update-impersonator.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Users users = new Users(client);

users.updateImpersonator(
"<USER_ID>", // userId
false, // impersonator
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

```
32 changes: 32 additions & 0 deletions docs/examples/java/webhooks/create.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Webhooks webhooks = new Webhooks(client);

webhooks.create(
"<WEBHOOK_ID>", // webhookId
"", // url
"<NAME>", // name
List.of(), // events
false, // enabled (optional)
false, // security (optional)
"<HTTP_USER>", // httpUser (optional)
"<HTTP_PASS>", // httpPass (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

```
25 changes: 25 additions & 0 deletions docs/examples/java/webhooks/delete.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Webhooks webhooks = new Webhooks(client);

webhooks.delete(
"<WEBHOOK_ID>", // webhookId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

```
25 changes: 25 additions & 0 deletions docs/examples/java/webhooks/get.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Webhooks webhooks = new Webhooks(client);

webhooks.get(
"<WEBHOOK_ID>", // webhookId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

```
Loading