Skip to content
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

fix: multipart testing #43

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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:6.1.0")
implementation("io.appwrite:sdk-for-kotlin:6.2.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>6.1.0</version>
<version>6.2.0</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/update-string-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ databases.updateStringAttribute(
"", // key
false, // required
"<DEFAULT>", // default
0, // size (optional)
1, // size (optional)
"", // newKey (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
9 changes: 6 additions & 3 deletions docs/examples/java/messaging/create-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Messaging messaging = new Messaging(client);

messaging.createPush(
"<MESSAGE_ID>", // messageId
"<TITLE>", // title
"<BODY>", // body
"<TITLE>", // title (optional)
"<BODY>", // body (optional)
listOf(), // topics (optional)
listOf(), // users (optional)
listOf(), // targets (optional)
Expand All @@ -23,9 +23,12 @@ messaging.createPush(
"<SOUND>", // sound (optional)
"<COLOR>", // color (optional)
"<TAG>", // tag (optional)
"<BADGE>", // badge (optional)
0, // badge (optional)
false, // draft (optional)
"", // scheduledAt (optional)
false, // contentAvailable (optional)
false, // critical (optional)
MessagePriority.NORMAL, // priority (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
3 changes: 3 additions & 0 deletions docs/examples/java/messaging/update-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ messaging.updatePush(
0, // badge (optional)
false, // draft (optional)
"", // scheduledAt (optional)
false, // contentAvailable (optional)
false, // critical (optional)
MessagePriority.NORMAL, // priority (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/kotlin/databases/update-string-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ val response = databases.updateStringAttribute(
key = "",
required = false,
default = "<DEFAULT>",
size = 0, // optional
size = 1, // optional
newKey = "" // optional
)
11 changes: 7 additions & 4 deletions docs/examples/kotlin/messaging/create-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ val messaging = Messaging(client)

val response = messaging.createPush(
messageId = "<MESSAGE_ID>",
title = "<TITLE>",
body = "<BODY>",
title = "<TITLE>", // optional
body = "<BODY>", // optional
topics = listOf(), // optional
users = listOf(), // optional
targets = listOf(), // optional
Expand All @@ -23,7 +23,10 @@ val response = messaging.createPush(
sound = "<SOUND>", // optional
color = "<COLOR>", // optional
tag = "<TAG>", // optional
badge = "<BADGE>", // optional
badge = 0, // optional
draft = false, // optional
scheduledAt = "" // optional
scheduledAt = "", // optional
contentAvailable = false, // optional
critical = false, // optional
priority = "normal" // optional
)
5 changes: 4 additions & 1 deletion docs/examples/kotlin/messaging/update-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ val response = messaging.updatePush(
tag = "<TAG>", // optional
badge = 0, // optional
draft = false, // optional
scheduledAt = "" // optional
scheduledAt = "", // optional
contentAvailable = false, // optional
critical = false, // optional
priority = "normal" // optional
)
4 changes: 2 additions & 2 deletions src/main/kotlin/io/appwrite/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class Client @JvmOverloads constructor(
init {
headers = mutableMapOf(
"content-type" to "application/json",
"user-agent" to "AppwriteKotlinSDK/6.1.0 ${System.getProperty("http.agent")}",
"user-agent" to "AppwriteKotlinSDK/6.2.0 ${System.getProperty("http.agent")}",
"x-sdk-name" to "Kotlin",
"x-sdk-platform" to "server",
"x-sdk-language" to "kotlin",
"x-sdk-version" to "6.1.0",
"x-sdk-version" to "6.2.0",
"x-appwrite-response-format" to "1.6.0",
)

Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/io/appwrite/enums/ImageFormat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ enum class ImageFormat(val value: String) {
@SerializedName("png")
PNG("png"),
@SerializedName("webp")
WEBP("webp");
WEBP("webp"),
@SerializedName("avif")
AVIF("avif");

override fun toString() = value
}
12 changes: 12 additions & 0 deletions src/main/kotlin/io/appwrite/enums/MessagePriority.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.appwrite.enums

import com.google.gson.annotations.SerializedName

enum class MessagePriority(val value: String) {
@SerializedName("normal")
NORMAL("normal"),
@SerializedName("high")
HIGH("high");

override fun toString() = value
}
32 changes: 29 additions & 3 deletions src/main/kotlin/io/appwrite/enums/Runtime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ enum class Runtime(val value: String) {
NODE_20_0("node-20.0"),
@SerializedName("node-21.0")
NODE_21_0("node-21.0"),
@SerializedName("node-22")
NODE_22("node-22"),
@SerializedName("php-8.0")
PHP_8_0("php-8.0"),
@SerializedName("php-8.1")
Expand Down Expand Up @@ -43,8 +45,18 @@ enum class Runtime(val value: String) {
PYTHON_3_12("python-3.12"),
@SerializedName("python-ml-3.11")
PYTHON_ML_3_11("python-ml-3.11"),
@SerializedName("deno-1.21")
DENO_1_21("deno-1.21"),
@SerializedName("deno-1.24")
DENO_1_24("deno-1.24"),
@SerializedName("deno-1.35")
DENO_1_35("deno-1.35"),
@SerializedName("deno-1.40")
DENO_1_40("deno-1.40"),
@SerializedName("deno-1.46")
DENO_1_46("deno-1.46"),
@SerializedName("deno-2.0")
DENO_2_0("deno-2.0"),
@SerializedName("dart-2.15")
DART_2_15("dart-2.15"),
@SerializedName("dart-2.16")
Expand All @@ -59,12 +71,14 @@ enum class Runtime(val value: String) {
DART_3_1("dart-3.1"),
@SerializedName("dart-3.3")
DART_3_3("dart-3.3"),
@SerializedName("dotnet-3.1")
DOTNET_3_1("dotnet-3.1"),
@SerializedName("dart-3.5")
DART_3_5("dart-3.5"),
@SerializedName("dotnet-6.0")
DOTNET_6_0("dotnet-6.0"),
@SerializedName("dotnet-7.0")
DOTNET_7_0("dotnet-7.0"),
@SerializedName("dotnet-8.0")
DOTNET_8_0("dotnet-8.0"),
@SerializedName("java-8.0")
JAVA_8_0("java-8.0"),
@SerializedName("java-11.0")
Expand All @@ -75,26 +89,38 @@ enum class Runtime(val value: String) {
JAVA_18_0("java-18.0"),
@SerializedName("java-21.0")
JAVA_21_0("java-21.0"),
@SerializedName("java-22")
JAVA_22("java-22"),
@SerializedName("swift-5.5")
SWIFT_5_5("swift-5.5"),
@SerializedName("swift-5.8")
SWIFT_5_8("swift-5.8"),
@SerializedName("swift-5.9")
SWIFT_5_9("swift-5.9"),
@SerializedName("swift-5.10")
SWIFT_5_10("swift-5.10"),
@SerializedName("kotlin-1.6")
KOTLIN_1_6("kotlin-1.6"),
@SerializedName("kotlin-1.8")
KOTLIN_1_8("kotlin-1.8"),
@SerializedName("kotlin-1.9")
KOTLIN_1_9("kotlin-1.9"),
@SerializedName("kotlin-2.0")
KOTLIN_2_0("kotlin-2.0"),
@SerializedName("cpp-17")
CPP_17("cpp-17"),
@SerializedName("cpp-20")
CPP_20("cpp-20"),
@SerializedName("bun-1.0")
BUN_1_0("bun-1.0"),
@SerializedName("bun-1.1")
BUN_1_1("bun-1.1"),
@SerializedName("go-1.23")
GO_1_23("go-1.23");
GO_1_23("go-1.23"),
@SerializedName("static-1")
STATIC_1("static-1"),
@SerializedName("flutter-3.24")
FLUTTER_3_24("flutter-3.24");

override fun toString() = value
}
16 changes: 16 additions & 0 deletions src/main/kotlin/io/appwrite/models/AttributeBoolean.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ data class AttributeBoolean(
@SerializedName("array")
var array: Boolean?,

/**
* Attribute creation date in ISO 8601 format.
*/
@SerializedName("\$createdAt")
val createdAt: String,

/**
* Attribute update date in ISO 8601 format.
*/
@SerializedName("\$updatedAt")
val updatedAt: String,

/**
* Default value for attribute when not provided. Cannot be set when attribute is required.
*/
Expand All @@ -57,6 +69,8 @@ data class AttributeBoolean(
"error" to error as Any,
"required" to required as Any,
"array" to array as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
"default" to default as Any,
)

Expand All @@ -72,6 +86,8 @@ data class AttributeBoolean(
error = map["error"] as String,
required = map["required"] as Boolean,
array = map["array"] as? Boolean?,
createdAt = map["\$createdAt"] as String,
updatedAt = map["\$updatedAt"] as String,
default = map["default"] as? Boolean?,
)
}
Expand Down
16 changes: 16 additions & 0 deletions src/main/kotlin/io/appwrite/models/AttributeDatetime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ data class AttributeDatetime(
@SerializedName("array")
var array: Boolean?,

/**
* Attribute creation date in ISO 8601 format.
*/
@SerializedName("\$createdAt")
val createdAt: String,

/**
* Attribute update date in ISO 8601 format.
*/
@SerializedName("\$updatedAt")
val updatedAt: String,

/**
* ISO 8601 format.
*/
Expand All @@ -63,6 +75,8 @@ data class AttributeDatetime(
"error" to error as Any,
"required" to required as Any,
"array" to array as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
"format" to format as Any,
"default" to default as Any,
)
Expand All @@ -79,6 +93,8 @@ data class AttributeDatetime(
error = map["error"] as String,
required = map["required"] as Boolean,
array = map["array"] as? Boolean?,
createdAt = map["\$createdAt"] as String,
updatedAt = map["\$updatedAt"] as String,
format = map["format"] as String,
default = map["default"] as? String?,
)
Expand Down
16 changes: 16 additions & 0 deletions src/main/kotlin/io/appwrite/models/AttributeEmail.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ data class AttributeEmail(
@SerializedName("array")
var array: Boolean?,

/**
* Attribute creation date in ISO 8601 format.
*/
@SerializedName("\$createdAt")
val createdAt: String,

/**
* Attribute update date in ISO 8601 format.
*/
@SerializedName("\$updatedAt")
val updatedAt: String,

/**
* String format.
*/
Expand All @@ -63,6 +75,8 @@ data class AttributeEmail(
"error" to error as Any,
"required" to required as Any,
"array" to array as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
"format" to format as Any,
"default" to default as Any,
)
Expand All @@ -79,6 +93,8 @@ data class AttributeEmail(
error = map["error"] as String,
required = map["required"] as Boolean,
array = map["array"] as? Boolean?,
createdAt = map["\$createdAt"] as String,
updatedAt = map["\$updatedAt"] as String,
format = map["format"] as String,
default = map["default"] as? String?,
)
Expand Down
20 changes: 18 additions & 2 deletions src/main/kotlin/io/appwrite/models/AttributeEnum.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,23 @@ data class AttributeEnum(
@SerializedName("array")
var array: Boolean?,

/**
* Attribute creation date in ISO 8601 format.
*/
@SerializedName("\$createdAt")
val createdAt: String,

/**
* Attribute update date in ISO 8601 format.
*/
@SerializedName("\$updatedAt")
val updatedAt: String,

/**
* Array of elements in enumerated type.
*/
@SerializedName("elements")
val elements: List<Any>,
val elements: List<String>,

/**
* String format.
Expand All @@ -69,6 +81,8 @@ data class AttributeEnum(
"error" to error as Any,
"required" to required as Any,
"array" to array as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
"elements" to elements as Any,
"format" to format as Any,
"default" to default as Any,
Expand All @@ -86,7 +100,9 @@ data class AttributeEnum(
error = map["error"] as String,
required = map["required"] as Boolean,
array = map["array"] as? Boolean?,
elements = map["elements"] as List<Any>,
createdAt = map["\$createdAt"] as String,
updatedAt = map["\$updatedAt"] as String,
elements = map["elements"] as List<String>,
format = map["format"] as String,
default = map["default"] as? String?,
)
Expand Down
Loading