Skip to content

Commit feef4c8

Browse files
Merge pull request #44 from appwrite/feat-push-params
Add new push message parameters
2 parents 9600602 + bc90200 commit feef4c8

Some content is hidden

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

42 files changed

+356
-102
lines changed

README.md

+3-3
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-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.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.6.1-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

@@ -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:6.1.0")
42+
implementation("io.appwrite:sdk-for-kotlin:6.2.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>6.1.0</version>
53+
<version>6.2.0</version>
5454
</dependency>
5555
</dependencies>
5656
```

docs/examples/java/databases/update-string-attribute.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ databases.updateStringAttribute(
1515
"", // key
1616
false, // required
1717
"<DEFAULT>", // default
18-
0, // size (optional)
18+
1, // size (optional)
1919
"", // newKey (optional)
2020
new CoroutineCallback<>((result, error) -> {
2121
if (error != null) {

docs/examples/java/messaging/create-push.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Messaging messaging = new Messaging(client);
1111

1212
messaging.createPush(
1313
"<MESSAGE_ID>", // messageId
14-
"<TITLE>", // title
15-
"<BODY>", // body
14+
"<TITLE>", // title (optional)
15+
"<BODY>", // body (optional)
1616
listOf(), // topics (optional)
1717
listOf(), // users (optional)
1818
listOf(), // targets (optional)
@@ -23,9 +23,12 @@ messaging.createPush(
2323
"<SOUND>", // sound (optional)
2424
"<COLOR>", // color (optional)
2525
"<TAG>", // tag (optional)
26-
"<BADGE>", // badge (optional)
26+
0, // badge (optional)
2727
false, // draft (optional)
2828
"", // scheduledAt (optional)
29+
false, // contentAvailable (optional)
30+
false, // critical (optional)
31+
MessagePriority.NORMAL, // priority (optional)
2932
new CoroutineCallback<>((result, error) -> {
3033
if (error != null) {
3134
error.printStackTrace();

docs/examples/java/messaging/update-push.md

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ messaging.updatePush(
2626
0, // badge (optional)
2727
false, // draft (optional)
2828
"", // scheduledAt (optional)
29+
false, // contentAvailable (optional)
30+
false, // critical (optional)
31+
MessagePriority.NORMAL, // priority (optional)
2932
new CoroutineCallback<>((result, error) -> {
3033
if (error != null) {
3134
error.printStackTrace();

docs/examples/kotlin/databases/update-string-attribute.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ val response = databases.updateStringAttribute(
1515
key = "",
1616
required = false,
1717
default = "<DEFAULT>",
18-
size = 0, // optional
18+
size = 1, // optional
1919
newKey = "" // optional
2020
)

docs/examples/kotlin/messaging/create-push.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ val messaging = Messaging(client)
1111

1212
val response = messaging.createPush(
1313
messageId = "<MESSAGE_ID>",
14-
title = "<TITLE>",
15-
body = "<BODY>",
14+
title = "<TITLE>", // optional
15+
body = "<BODY>", // optional
1616
topics = listOf(), // optional
1717
users = listOf(), // optional
1818
targets = listOf(), // optional
@@ -23,7 +23,10 @@ val response = messaging.createPush(
2323
sound = "<SOUND>", // optional
2424
color = "<COLOR>", // optional
2525
tag = "<TAG>", // optional
26-
badge = "<BADGE>", // optional
26+
badge = 0, // optional
2727
draft = false, // optional
28-
scheduledAt = "" // optional
28+
scheduledAt = "", // optional
29+
contentAvailable = false, // optional
30+
critical = false, // optional
31+
priority = "normal" // optional
2932
)

docs/examples/kotlin/messaging/update-push.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ val response = messaging.updatePush(
2525
tag = "<TAG>", // optional
2626
badge = 0, // optional
2727
draft = false, // optional
28-
scheduledAt = "" // optional
28+
scheduledAt = "", // optional
29+
contentAvailable = false, // optional
30+
critical = false, // optional
31+
priority = "normal" // optional
2932
)

src/main/kotlin/io/appwrite/Client.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ class Client @JvmOverloads constructor(
5757
init {
5858
headers = mutableMapOf(
5959
"content-type" to "application/json",
60-
"user-agent" to "AppwriteKotlinSDK/6.1.0 ${System.getProperty("http.agent")}",
60+
"user-agent" to "AppwriteKotlinSDK/6.2.0 ${System.getProperty("http.agent")}",
6161
"x-sdk-name" to "Kotlin",
6262
"x-sdk-platform" to "server",
6363
"x-sdk-language" to "kotlin",
64-
"x-sdk-version" to "6.1.0",
64+
"x-sdk-version" to "6.2.0",
6565
"x-appwrite-response-format" to "1.6.0",
6666
)
6767

src/main/kotlin/io/appwrite/enums/ImageFormat.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ enum class ImageFormat(val value: String) {
1212
@SerializedName("png")
1313
PNG("png"),
1414
@SerializedName("webp")
15-
WEBP("webp");
15+
WEBP("webp"),
16+
@SerializedName("avif")
17+
AVIF("avif");
1618

1719
override fun toString() = value
1820
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.appwrite.enums
2+
3+
import com.google.gson.annotations.SerializedName
4+
5+
enum class MessagePriority(val value: String) {
6+
@SerializedName("normal")
7+
NORMAL("normal"),
8+
@SerializedName("high")
9+
HIGH("high");
10+
11+
override fun toString() = value
12+
}

src/main/kotlin/io/appwrite/enums/Runtime.kt

+29-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ enum class Runtime(val value: String) {
1515
NODE_20_0("node-20.0"),
1616
@SerializedName("node-21.0")
1717
NODE_21_0("node-21.0"),
18+
@SerializedName("node-22")
19+
NODE_22("node-22"),
1820
@SerializedName("php-8.0")
1921
PHP_8_0("php-8.0"),
2022
@SerializedName("php-8.1")
@@ -43,8 +45,18 @@ enum class Runtime(val value: String) {
4345
PYTHON_3_12("python-3.12"),
4446
@SerializedName("python-ml-3.11")
4547
PYTHON_ML_3_11("python-ml-3.11"),
48+
@SerializedName("deno-1.21")
49+
DENO_1_21("deno-1.21"),
50+
@SerializedName("deno-1.24")
51+
DENO_1_24("deno-1.24"),
52+
@SerializedName("deno-1.35")
53+
DENO_1_35("deno-1.35"),
4654
@SerializedName("deno-1.40")
4755
DENO_1_40("deno-1.40"),
56+
@SerializedName("deno-1.46")
57+
DENO_1_46("deno-1.46"),
58+
@SerializedName("deno-2.0")
59+
DENO_2_0("deno-2.0"),
4860
@SerializedName("dart-2.15")
4961
DART_2_15("dart-2.15"),
5062
@SerializedName("dart-2.16")
@@ -59,12 +71,14 @@ enum class Runtime(val value: String) {
5971
DART_3_1("dart-3.1"),
6072
@SerializedName("dart-3.3")
6173
DART_3_3("dart-3.3"),
62-
@SerializedName("dotnet-3.1")
63-
DOTNET_3_1("dotnet-3.1"),
74+
@SerializedName("dart-3.5")
75+
DART_3_5("dart-3.5"),
6476
@SerializedName("dotnet-6.0")
6577
DOTNET_6_0("dotnet-6.0"),
6678
@SerializedName("dotnet-7.0")
6779
DOTNET_7_0("dotnet-7.0"),
80+
@SerializedName("dotnet-8.0")
81+
DOTNET_8_0("dotnet-8.0"),
6882
@SerializedName("java-8.0")
6983
JAVA_8_0("java-8.0"),
7084
@SerializedName("java-11.0")
@@ -75,26 +89,38 @@ enum class Runtime(val value: String) {
7589
JAVA_18_0("java-18.0"),
7690
@SerializedName("java-21.0")
7791
JAVA_21_0("java-21.0"),
92+
@SerializedName("java-22")
93+
JAVA_22("java-22"),
7894
@SerializedName("swift-5.5")
7995
SWIFT_5_5("swift-5.5"),
8096
@SerializedName("swift-5.8")
8197
SWIFT_5_8("swift-5.8"),
8298
@SerializedName("swift-5.9")
8399
SWIFT_5_9("swift-5.9"),
100+
@SerializedName("swift-5.10")
101+
SWIFT_5_10("swift-5.10"),
84102
@SerializedName("kotlin-1.6")
85103
KOTLIN_1_6("kotlin-1.6"),
86104
@SerializedName("kotlin-1.8")
87105
KOTLIN_1_8("kotlin-1.8"),
88106
@SerializedName("kotlin-1.9")
89107
KOTLIN_1_9("kotlin-1.9"),
108+
@SerializedName("kotlin-2.0")
109+
KOTLIN_2_0("kotlin-2.0"),
90110
@SerializedName("cpp-17")
91111
CPP_17("cpp-17"),
92112
@SerializedName("cpp-20")
93113
CPP_20("cpp-20"),
94114
@SerializedName("bun-1.0")
95115
BUN_1_0("bun-1.0"),
116+
@SerializedName("bun-1.1")
117+
BUN_1_1("bun-1.1"),
96118
@SerializedName("go-1.23")
97-
GO_1_23("go-1.23");
119+
GO_1_23("go-1.23"),
120+
@SerializedName("static-1")
121+
STATIC_1("static-1"),
122+
@SerializedName("flutter-3.24")
123+
FLUTTER_3_24("flutter-3.24");
98124

99125
override fun toString() = value
100126
}

src/main/kotlin/io/appwrite/models/AttributeBoolean.kt

+16
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ data class AttributeBoolean(
4343
@SerializedName("array")
4444
var array: Boolean?,
4545

46+
/**
47+
* Attribute creation date in ISO 8601 format.
48+
*/
49+
@SerializedName("\$createdAt")
50+
val createdAt: String,
51+
52+
/**
53+
* Attribute update date in ISO 8601 format.
54+
*/
55+
@SerializedName("\$updatedAt")
56+
val updatedAt: String,
57+
4658
/**
4759
* Default value for attribute when not provided. Cannot be set when attribute is required.
4860
*/
@@ -57,6 +69,8 @@ data class AttributeBoolean(
5769
"error" to error as Any,
5870
"required" to required as Any,
5971
"array" to array as Any,
72+
"\$createdAt" to createdAt as Any,
73+
"\$updatedAt" to updatedAt as Any,
6074
"default" to default as Any,
6175
)
6276

@@ -72,6 +86,8 @@ data class AttributeBoolean(
7286
error = map["error"] as String,
7387
required = map["required"] as Boolean,
7488
array = map["array"] as? Boolean?,
89+
createdAt = map["\$createdAt"] as String,
90+
updatedAt = map["\$updatedAt"] as String,
7591
default = map["default"] as? Boolean?,
7692
)
7793
}

src/main/kotlin/io/appwrite/models/AttributeDatetime.kt

+16
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ data class AttributeDatetime(
4343
@SerializedName("array")
4444
var array: Boolean?,
4545

46+
/**
47+
* Attribute creation date in ISO 8601 format.
48+
*/
49+
@SerializedName("\$createdAt")
50+
val createdAt: String,
51+
52+
/**
53+
* Attribute update date in ISO 8601 format.
54+
*/
55+
@SerializedName("\$updatedAt")
56+
val updatedAt: String,
57+
4658
/**
4759
* ISO 8601 format.
4860
*/
@@ -63,6 +75,8 @@ data class AttributeDatetime(
6375
"error" to error as Any,
6476
"required" to required as Any,
6577
"array" to array as Any,
78+
"\$createdAt" to createdAt as Any,
79+
"\$updatedAt" to updatedAt as Any,
6680
"format" to format as Any,
6781
"default" to default as Any,
6882
)
@@ -79,6 +93,8 @@ data class AttributeDatetime(
7993
error = map["error"] as String,
8094
required = map["required"] as Boolean,
8195
array = map["array"] as? Boolean?,
96+
createdAt = map["\$createdAt"] as String,
97+
updatedAt = map["\$updatedAt"] as String,
8298
format = map["format"] as String,
8399
default = map["default"] as? String?,
84100
)

src/main/kotlin/io/appwrite/models/AttributeEmail.kt

+16
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ data class AttributeEmail(
4343
@SerializedName("array")
4444
var array: Boolean?,
4545

46+
/**
47+
* Attribute creation date in ISO 8601 format.
48+
*/
49+
@SerializedName("\$createdAt")
50+
val createdAt: String,
51+
52+
/**
53+
* Attribute update date in ISO 8601 format.
54+
*/
55+
@SerializedName("\$updatedAt")
56+
val updatedAt: String,
57+
4658
/**
4759
* String format.
4860
*/
@@ -63,6 +75,8 @@ data class AttributeEmail(
6375
"error" to error as Any,
6476
"required" to required as Any,
6577
"array" to array as Any,
78+
"\$createdAt" to createdAt as Any,
79+
"\$updatedAt" to updatedAt as Any,
6680
"format" to format as Any,
6781
"default" to default as Any,
6882
)
@@ -79,6 +93,8 @@ data class AttributeEmail(
7993
error = map["error"] as String,
8094
required = map["required"] as Boolean,
8195
array = map["array"] as? Boolean?,
96+
createdAt = map["\$createdAt"] as String,
97+
updatedAt = map["\$updatedAt"] as String,
8298
format = map["format"] as String,
8399
default = map["default"] as? String?,
84100
)

src/main/kotlin/io/appwrite/models/AttributeEnum.kt

+18-2
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,23 @@ data class AttributeEnum(
4343
@SerializedName("array")
4444
var array: Boolean?,
4545

46+
/**
47+
* Attribute creation date in ISO 8601 format.
48+
*/
49+
@SerializedName("\$createdAt")
50+
val createdAt: String,
51+
52+
/**
53+
* Attribute update date in ISO 8601 format.
54+
*/
55+
@SerializedName("\$updatedAt")
56+
val updatedAt: String,
57+
4658
/**
4759
* Array of elements in enumerated type.
4860
*/
4961
@SerializedName("elements")
50-
val elements: List<Any>,
62+
val elements: List<String>,
5163

5264
/**
5365
* String format.
@@ -69,6 +81,8 @@ data class AttributeEnum(
6981
"error" to error as Any,
7082
"required" to required as Any,
7183
"array" to array as Any,
84+
"\$createdAt" to createdAt as Any,
85+
"\$updatedAt" to updatedAt as Any,
7286
"elements" to elements as Any,
7387
"format" to format as Any,
7488
"default" to default as Any,
@@ -86,7 +100,9 @@ data class AttributeEnum(
86100
error = map["error"] as String,
87101
required = map["required"] as Boolean,
88102
array = map["array"] as? Boolean?,
89-
elements = map["elements"] as List<Any>,
103+
createdAt = map["\$createdAt"] as String,
104+
updatedAt = map["\$updatedAt"] as String,
105+
elements = map["elements"] as List<String>,
90106
format = map["format"] as String,
91107
default = map["default"] as? String?,
92108
)

0 commit comments

Comments
 (0)