Skip to content

Dev #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 18, 2025
Merged

Dev #49

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
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.6.2-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.7.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.7.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:8.0.0")
implementation("io.appwrite:sdk-for-kotlin:9.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>8.0.0</version>
<version>9.0.0</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/avatars/get-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/avatars/get-credit-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/avatars/get-flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/java/databases/create-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession(""); // The user session to authenticate with
.setSession("") // The user session to authenticate with
.setKey("<YOUR_API_KEY>") // Your secret API key
.setJWT("<YOUR_JWT>"); // Your secret JSON Web Token

Databases databases = new Databases(client);

Expand Down
24 changes: 24 additions & 0 deletions docs/examples/java/databases/create-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setKey("<YOUR_API_KEY>"); // Your secret API key

Databases databases = new Databases(client);

databases.createDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // documents
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

1 change: 1 addition & 0 deletions docs/examples/java/databases/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
25 changes: 25 additions & 0 deletions docs/examples/java/databases/delete-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

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

Databases databases = new Databases(client);

databases.deleteDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // queries (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

26 changes: 26 additions & 0 deletions docs/examples/java/databases/update-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

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

Databases databases = new Databases(client);

databases.updateDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
mapOf( "a" to "b" ), // data (optional)
listOf(), // queries (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

25 changes: 25 additions & 0 deletions docs/examples/java/databases/upsert-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

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

Databases databases = new Databases(client);

databases.upsertDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // documents (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Client client = new Client()

Functions functions = new Functions(client);

functions.createBuild(
functions.createDuplicateDeployment(
"<FUNCTION_ID>", // functionId
"<DEPLOYMENT_ID>", // deploymentId
"<BUILD_ID>", // buildId (optional)
Expand Down
28 changes: 28 additions & 0 deletions docs/examples/java/functions/create-template-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Functions;

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

Functions functions = new Functions(client);

functions.createTemplateDeployment(
"<FUNCTION_ID>", // functionId
"<REPOSITORY>", // repository
"<OWNER>", // owner
"<ROOT_DIRECTORY>", // rootDirectory
"<VERSION>", // version
false, // activate (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

1 change: 1 addition & 0 deletions docs/examples/java/functions/create-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ functions.createVariable(
"<FUNCTION_ID>", // functionId
"<KEY>", // key
"<VALUE>", // value
false, // secret (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
27 changes: 27 additions & 0 deletions docs/examples/java/functions/create-vcs-deployment.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Functions functions = new Functions(client);

functions.createVcsDeployment(
"<FUNCTION_ID>", // functionId
VCSDeploymentType.BRANCH, // type
"<REFERENCE>", // reference
false, // activate (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

4 changes: 0 additions & 4 deletions docs/examples/java/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ functions.create(
"<PROVIDER_BRANCH>", // providerBranch (optional)
false, // providerSilentMode (optional)
"<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional)
"<TEMPLATE_REPOSITORY>", // templateRepository (optional)
"<TEMPLATE_OWNER>", // templateOwner (optional)
"<TEMPLATE_ROOT_DIRECTORY>", // templateRootDirectory (optional)
"<TEMPLATE_VERSION>", // templateVersion (optional)
"", // specification (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/functions/get-deployment-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Functions functions = new Functions(client);
functions.getDeploymentDownload(
"<FUNCTION_ID>", // functionId
"<DEPLOYMENT_ID>", // deploymentId
DeploymentDownloadType.SOURCE, // type (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 0 additions & 1 deletion docs/examples/java/functions/list-executions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Functions functions = new Functions(client);
functions.listExecutions(
"<FUNCTION_ID>", // functionId
listOf(), // queries (optional)
"<SEARCH>", // search (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Client client = new Client()

Functions functions = new Functions(client);

functions.updateDeploymentBuild(
functions.updateDeploymentStatus(
"<FUNCTION_ID>", // functionId
"<DEPLOYMENT_ID>", // deploymentId
new CoroutineCallback<>((result, error) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Client client = new Client()

Functions functions = new Functions(client);

functions.updateDeployment(
functions.updateFunctionDeployment(
"<FUNCTION_ID>", // functionId
"<DEPLOYMENT_ID>", // deploymentId
new CoroutineCallback<>((result, error) -> {
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/functions/update-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ functions.updateVariable(
"<VARIABLE_ID>", // variableId
"<KEY>", // key
"<VALUE>", // value (optional)
false, // secret (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
29 changes: 29 additions & 0 deletions docs/examples/java/sites/create-deployment.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Sites sites = new Sites(client);

sites.createDeployment(
"<SITE_ID>", // siteId
InputFile.fromPath("file.png"), // code
false, // activate
"<INSTALL_COMMAND>", // installCommand (optional)
"<BUILD_COMMAND>", // buildCommand (optional)
"<OUTPUT_DIRECTORY>", // outputDirectory (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

24 changes: 24 additions & 0 deletions docs/examples/java/sites/create-duplicate-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Sites;

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

Sites sites = new Sites(client);

sites.createDuplicateDeployment(
"<SITE_ID>", // siteId
"<DEPLOYMENT_ID>", // deploymentId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

28 changes: 28 additions & 0 deletions docs/examples/java/sites/create-template-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Sites;

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

Sites sites = new Sites(client);

sites.createTemplateDeployment(
"<SITE_ID>", // siteId
"<REPOSITORY>", // repository
"<OWNER>", // owner
"<ROOT_DIRECTORY>", // rootDirectory
"<VERSION>", // version
false, // activate (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

Loading