Skip to content

Commit 219f7c7

Browse files
authored
Merge pull request #49 from appwrite/dev
Dev
2 parents e84b6a1 + 3ea72af commit 219f7c7

File tree

136 files changed

+4030
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+4030
-232
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**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).**
9+
**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).**
1010

1111
> 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)
1212
@@ -39,7 +39,7 @@ repositories {
3939
Next, add the dependency to your project's `build.gradle(.kts)` file:
4040

4141
```groovy
42-
implementation("io.appwrite:sdk-for-kotlin:8.0.0")
42+
implementation("io.appwrite:sdk-for-kotlin:9.0.0")
4343
```
4444

4545
### Maven
@@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
5050
<dependency>
5151
<groupId>io.appwrite</groupId>
5252
<artifactId>sdk-for-kotlin</artifactId>
53-
<version>8.0.0</version>
53+
<version>9.0.0</version>
5454
</dependency>
5555
</dependencies>
5656
```

docs/examples/java/avatars/get-browser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ avatars.getBrowser(
1414
Browser.AVANT_BROWSER, // code
1515
0, // width (optional)
1616
0, // height (optional)
17-
0, // quality (optional)
17+
-1, // quality (optional)
1818
new CoroutineCallback<>((result, error) -> {
1919
if (error != null) {
2020
error.printStackTrace();

docs/examples/java/avatars/get-credit-card.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ avatars.getCreditCard(
1414
CreditCard.AMERICAN_EXPRESS, // code
1515
0, // width (optional)
1616
0, // height (optional)
17-
0, // quality (optional)
17+
-1, // quality (optional)
1818
new CoroutineCallback<>((result, error) -> {
1919
if (error != null) {
2020
error.printStackTrace();

docs/examples/java/avatars/get-flag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ avatars.getFlag(
1414
Flag.AFGHANISTAN, // code
1515
0, // width (optional)
1616
0, // height (optional)
17-
0, // quality (optional)
17+
-1, // quality (optional)
1818
new CoroutineCallback<>((result, error) -> {
1919
if (error != null) {
2020
error.printStackTrace();

docs/examples/java/databases/create-document.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import io.appwrite.services.Databases;
44

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

1011
Databases databases = new Databases(client);
1112

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Databases;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setKey("<YOUR_API_KEY>"); // Your secret API key
8+
9+
Databases databases = new Databases(client);
10+
11+
databases.createDocuments(
12+
"<DATABASE_ID>", // databaseId
13+
"<COLLECTION_ID>", // collectionId
14+
listOf(), // documents
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
System.out.println(result);
22+
})
23+
);
24+

docs/examples/java/databases/create-index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ databases.createIndex(
1717
IndexType.KEY, // type
1818
listOf(), // attributes
1919
listOf(), // orders (optional)
20+
listOf(), // lengths (optional)
2021
new CoroutineCallback<>((result, error) -> {
2122
if (error != null) {
2223
error.printStackTrace();
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Databases;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Databases databases = new Databases(client);
11+
12+
databases.deleteDocuments(
13+
"<DATABASE_ID>", // databaseId
14+
"<COLLECTION_ID>", // collectionId
15+
listOf(), // queries (optional)
16+
new CoroutineCallback<>((result, error) -> {
17+
if (error != null) {
18+
error.printStackTrace();
19+
return;
20+
}
21+
22+
System.out.println(result);
23+
})
24+
);
25+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Databases;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Databases databases = new Databases(client);
11+
12+
databases.updateDocuments(
13+
"<DATABASE_ID>", // databaseId
14+
"<COLLECTION_ID>", // collectionId
15+
mapOf( "a" to "b" ), // data (optional)
16+
listOf(), // queries (optional)
17+
new CoroutineCallback<>((result, error) -> {
18+
if (error != null) {
19+
error.printStackTrace();
20+
return;
21+
}
22+
23+
System.out.println(result);
24+
})
25+
);
26+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Databases;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Databases databases = new Databases(client);
11+
12+
databases.upsertDocuments(
13+
"<DATABASE_ID>", // databaseId
14+
"<COLLECTION_ID>", // collectionId
15+
listOf(), // documents (optional)
16+
new CoroutineCallback<>((result, error) -> {
17+
if (error != null) {
18+
error.printStackTrace();
19+
return;
20+
}
21+
22+
System.out.println(result);
23+
})
24+
);
25+

docs/examples/java/functions/create-build.md renamed to docs/examples/java/functions/create-duplicate-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client()
99

1010
Functions functions = new Functions(client);
1111

12-
functions.createBuild(
12+
functions.createDuplicateDeployment(
1313
"<FUNCTION_ID>", // functionId
1414
"<DEPLOYMENT_ID>", // deploymentId
1515
"<BUILD_ID>", // buildId (optional)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Functions;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Functions functions = new Functions(client);
11+
12+
functions.createTemplateDeployment(
13+
"<FUNCTION_ID>", // functionId
14+
"<REPOSITORY>", // repository
15+
"<OWNER>", // owner
16+
"<ROOT_DIRECTORY>", // rootDirectory
17+
"<VERSION>", // version
18+
false, // activate (optional)
19+
new CoroutineCallback<>((result, error) -> {
20+
if (error != null) {
21+
error.printStackTrace();
22+
return;
23+
}
24+
25+
System.out.println(result);
26+
})
27+
);
28+

docs/examples/java/functions/create-variable.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ functions.createVariable(
1313
"<FUNCTION_ID>", // functionId
1414
"<KEY>", // key
1515
"<VALUE>", // value
16+
false, // secret (optional)
1617
new CoroutineCallback<>((result, error) -> {
1718
if (error != null) {
1819
error.printStackTrace();
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Functions;
4+
import io.appwrite.enums.VCSDeploymentType;
5+
6+
Client client = new Client()
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
9+
.setKey("<YOUR_API_KEY>"); // Your secret API key
10+
11+
Functions functions = new Functions(client);
12+
13+
functions.createVcsDeployment(
14+
"<FUNCTION_ID>", // functionId
15+
VCSDeploymentType.BRANCH, // type
16+
"<REFERENCE>", // reference
17+
false, // activate (optional)
18+
new CoroutineCallback<>((result, error) -> {
19+
if (error != null) {
20+
error.printStackTrace();
21+
return;
22+
}
23+
24+
System.out.println(result);
25+
})
26+
);
27+

docs/examples/java/functions/create.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ functions.create(
2828
"<PROVIDER_BRANCH>", // providerBranch (optional)
2929
false, // providerSilentMode (optional)
3030
"<PROVIDER_ROOT_DIRECTORY>", // providerRootDirectory (optional)
31-
"<TEMPLATE_REPOSITORY>", // templateRepository (optional)
32-
"<TEMPLATE_OWNER>", // templateOwner (optional)
33-
"<TEMPLATE_ROOT_DIRECTORY>", // templateRootDirectory (optional)
34-
"<TEMPLATE_VERSION>", // templateVersion (optional)
3531
"", // specification (optional)
3632
new CoroutineCallback<>((result, error) -> {
3733
if (error != null) {

docs/examples/java/functions/get-deployment-download.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Functions functions = new Functions(client);
1212
functions.getDeploymentDownload(
1313
"<FUNCTION_ID>", // functionId
1414
"<DEPLOYMENT_ID>", // deploymentId
15+
DeploymentDownloadType.SOURCE, // type (optional)
1516
new CoroutineCallback<>((result, error) -> {
1617
if (error != null) {
1718
error.printStackTrace();

docs/examples/java/functions/list-executions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Functions functions = new Functions(client);
1212
functions.listExecutions(
1313
"<FUNCTION_ID>", // functionId
1414
listOf(), // queries (optional)
15-
"<SEARCH>", // search (optional)
1615
new CoroutineCallback<>((result, error) -> {
1716
if (error != null) {
1817
error.printStackTrace();

docs/examples/java/functions/update-deployment-build.md renamed to docs/examples/java/functions/update-deployment-status.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client()
99

1010
Functions functions = new Functions(client);
1111

12-
functions.updateDeploymentBuild(
12+
functions.updateDeploymentStatus(
1313
"<FUNCTION_ID>", // functionId
1414
"<DEPLOYMENT_ID>", // deploymentId
1515
new CoroutineCallback<>((result, error) -> {

docs/examples/java/functions/update-deployment.md renamed to docs/examples/java/functions/update-function-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client()
99

1010
Functions functions = new Functions(client);
1111

12-
functions.updateDeployment(
12+
functions.updateFunctionDeployment(
1313
"<FUNCTION_ID>", // functionId
1414
"<DEPLOYMENT_ID>", // deploymentId
1515
new CoroutineCallback<>((result, error) -> {

docs/examples/java/functions/update-variable.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ functions.updateVariable(
1414
"<VARIABLE_ID>", // variableId
1515
"<KEY>", // key
1616
"<VALUE>", // value (optional)
17+
false, // secret (optional)
1718
new CoroutineCallback<>((result, error) -> {
1819
if (error != null) {
1920
error.printStackTrace();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.models.InputFile;
4+
import io.appwrite.services.Sites;
5+
6+
Client client = new Client()
7+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
9+
.setKey("<YOUR_API_KEY>"); // Your secret API key
10+
11+
Sites sites = new Sites(client);
12+
13+
sites.createDeployment(
14+
"<SITE_ID>", // siteId
15+
InputFile.fromPath("file.png"), // code
16+
false, // activate
17+
"<INSTALL_COMMAND>", // installCommand (optional)
18+
"<BUILD_COMMAND>", // buildCommand (optional)
19+
"<OUTPUT_DIRECTORY>", // outputDirectory (optional)
20+
new CoroutineCallback<>((result, error) -> {
21+
if (error != null) {
22+
error.printStackTrace();
23+
return;
24+
}
25+
26+
System.out.println(result);
27+
})
28+
);
29+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Sites;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Sites sites = new Sites(client);
11+
12+
sites.createDuplicateDeployment(
13+
"<SITE_ID>", // siteId
14+
"<DEPLOYMENT_ID>", // deploymentId
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
System.out.println(result);
22+
})
23+
);
24+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Sites;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Sites sites = new Sites(client);
11+
12+
sites.createTemplateDeployment(
13+
"<SITE_ID>", // siteId
14+
"<REPOSITORY>", // repository
15+
"<OWNER>", // owner
16+
"<ROOT_DIRECTORY>", // rootDirectory
17+
"<VERSION>", // version
18+
false, // activate (optional)
19+
new CoroutineCallback<>((result, error) -> {
20+
if (error != null) {
21+
error.printStackTrace();
22+
return;
23+
}
24+
25+
System.out.println(result);
26+
})
27+
);
28+

0 commit comments

Comments
 (0)