Skip to content

Commit 4e9e8a9

Browse files
Merge pull request #79 from appwrite/dev
Add inc/dec
2 parents 7b1cb56 + b36d2af commit 4e9e8a9

File tree

12 files changed

+283
-14
lines changed

12 files changed

+283
-14
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
# Change Log
22

3+
## 8.2.0
4+
5+
* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service
6+
* Add `gif` support to `ImageFormat` enum
7+
* Add `sequence` support to `Document` model
8+
9+
## 8.1.0
10+
11+
* Add `devKeys` support to `Client` service
12+
* Add `upsertDocument` support to `Databases` service
13+
314
## 8.0.0
415

516
* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage
617
* Update default `quality` for `getFilePreview` from 0 to -1
718
* Remove `Gif` from ImageFormat enum
8-
* Remove `search` param from `listExecutions` method
19+
* Remove `search` param from `listExecutions` method
20+
21+
## 7.0.1
22+
23+
* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests

README.md

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

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
@@ -38,7 +38,7 @@ repositories {
3838
Next, add the dependency to your project's `build.gradle(.kts)` file:
3939

4040
```groovy
41-
implementation("io.appwrite:sdk-for-android:8.1.0")
41+
implementation("io.appwrite:sdk-for-android:8.2.0")
4242
```
4343

4444
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
4949
<dependency>
5050
<groupId>io.appwrite</groupId>
5151
<artifactId>sdk-for-android</artifactId>
52-
<version>8.1.0</version>
52+
<version>8.2.0</version>
5353
</dependency>
5454
</dependencies>
5555
```

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

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

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

119
Databases databases = new Databases(client);
1210

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.Databases;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
8+
9+
Databases databases = new Databases(client);
10+
11+
databases.decrementDocumentAttribute(
12+
"<DATABASE_ID>", // databaseId
13+
"<COLLECTION_ID>", // collectionId
14+
"<DOCUMENT_ID>", // documentId
15+
"", // attribute
16+
0, // value (optional)
17+
0, // min (optional)
18+
new CoroutineCallback<>((result, error) -> {
19+
if (error != null) {
20+
error.printStackTrace();
21+
return;
22+
}
23+
24+
Log.d("Appwrite", result.toString());
25+
})
26+
);
27+
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.Databases;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
8+
9+
Databases databases = new Databases(client);
10+
11+
databases.incrementDocumentAttribute(
12+
"<DATABASE_ID>", // databaseId
13+
"<COLLECTION_ID>", // collectionId
14+
"<DOCUMENT_ID>", // documentId
15+
"", // attribute
16+
0, // value (optional)
17+
0, // max (optional)
18+
new CoroutineCallback<>((result, error) -> {
19+
if (error != null) {
20+
error.printStackTrace();
21+
return;
22+
}
23+
24+
Log.d("Appwrite", result.toString());
25+
})
26+
);
27+

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import io.appwrite.services.Databases
44

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

119
val databases = Databases(client)
1210

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import io.appwrite.Client
2+
import io.appwrite.coroutines.CoroutineCallback
3+
import io.appwrite.services.Databases
4+
5+
val client = Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
9+
val databases = Databases(client)
10+
11+
val result = databases.decrementDocumentAttribute(
12+
databaseId = "<DATABASE_ID>",
13+
collectionId = "<COLLECTION_ID>",
14+
documentId = "<DOCUMENT_ID>",
15+
attribute = "",
16+
value = 0, // (optional)
17+
min = 0, // (optional)
18+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import io.appwrite.Client
2+
import io.appwrite.coroutines.CoroutineCallback
3+
import io.appwrite.services.Databases
4+
5+
val client = Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
9+
val databases = Databases(client)
10+
11+
val result = databases.incrementDocumentAttribute(
12+
databaseId = "<DATABASE_ID>",
13+
collectionId = "<COLLECTION_ID>",
14+
documentId = "<DOCUMENT_ID>",
15+
attribute = "",
16+
value = 0, // (optional)
17+
max = 0, // (optional)
18+
)

library/src/main/java/io/appwrite/Client.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Client @JvmOverloads constructor(
8787
"x-sdk-name" to "Android",
8888
"x-sdk-platform" to "client",
8989
"x-sdk-language" to "android",
90-
"x-sdk-version" to "8.1.0",
90+
"x-sdk-version" to "8.2.0",
9191
"x-appwrite-response-format" to "1.7.0"
9292
)
9393
config = mutableMapOf()

library/src/main/java/io/appwrite/enums/ImageFormat.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ enum class ImageFormat(val value: String) {
1414
@SerializedName("heic")
1515
HEIC("heic"),
1616
@SerializedName("avif")
17-
AVIF("avif");
17+
AVIF("avif"),
18+
@SerializedName("gif")
19+
GIF("gif");
1820

1921
override fun toString() = value
2022
}

0 commit comments

Comments
 (0)