diff --git a/README.md b/README.md index bddbe28..5786e19 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file: io.appwrite sdk-for-kotlin - 6.1.0 + 6.2.0 ``` diff --git a/docs/examples/java/databases/update-string-attribute.md b/docs/examples/java/databases/update-string-attribute.md index 75be9e0..2d69006 100644 --- a/docs/examples/java/databases/update-string-attribute.md +++ b/docs/examples/java/databases/update-string-attribute.md @@ -15,7 +15,7 @@ databases.updateStringAttribute( "", // key false, // required "", // default - 0, // size (optional) + 1, // size (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/messaging/create-push.md b/docs/examples/java/messaging/create-push.md index 934f1fa..56c7a60 100644 --- a/docs/examples/java/messaging/create-push.md +++ b/docs/examples/java/messaging/create-push.md @@ -11,8 +11,8 @@ Messaging messaging = new Messaging(client); messaging.createPush( "", // messageId - "", // title - "<BODY>", // body + "<TITLE>", // title (optional) + "<BODY>", // body (optional) listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) @@ -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(); diff --git a/docs/examples/java/messaging/update-push.md b/docs/examples/java/messaging/update-push.md index ef04203..bb8c3c8 100644 --- a/docs/examples/java/messaging/update-push.md +++ b/docs/examples/java/messaging/update-push.md @@ -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(); diff --git a/docs/examples/kotlin/databases/update-string-attribute.md b/docs/examples/kotlin/databases/update-string-attribute.md index a37d456..32e17be 100644 --- a/docs/examples/kotlin/databases/update-string-attribute.md +++ b/docs/examples/kotlin/databases/update-string-attribute.md @@ -15,6 +15,6 @@ val response = databases.updateStringAttribute( key = "", required = false, default = "<DEFAULT>", - size = 0, // optional + size = 1, // optional newKey = "" // optional ) diff --git a/docs/examples/kotlin/messaging/create-push.md b/docs/examples/kotlin/messaging/create-push.md index 6a95f63..f92a49d 100644 --- a/docs/examples/kotlin/messaging/create-push.md +++ b/docs/examples/kotlin/messaging/create-push.md @@ -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 @@ -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 ) diff --git a/docs/examples/kotlin/messaging/update-push.md b/docs/examples/kotlin/messaging/update-push.md index d91694e..0ba72c4 100644 --- a/docs/examples/kotlin/messaging/update-push.md +++ b/docs/examples/kotlin/messaging/update-push.md @@ -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 ) diff --git a/src/main/kotlin/io/appwrite/Client.kt b/src/main/kotlin/io/appwrite/Client.kt index 8c18320..c8ff8d9 100644 --- a/src/main/kotlin/io/appwrite/Client.kt +++ b/src/main/kotlin/io/appwrite/Client.kt @@ -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", ) diff --git a/src/main/kotlin/io/appwrite/enums/ImageFormat.kt b/src/main/kotlin/io/appwrite/enums/ImageFormat.kt index c6a3b0f..25eea90 100644 --- a/src/main/kotlin/io/appwrite/enums/ImageFormat.kt +++ b/src/main/kotlin/io/appwrite/enums/ImageFormat.kt @@ -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 } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/MessagePriority.kt b/src/main/kotlin/io/appwrite/enums/MessagePriority.kt new file mode 100644 index 0000000..6218c1e --- /dev/null +++ b/src/main/kotlin/io/appwrite/enums/MessagePriority.kt @@ -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 +} \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Runtime.kt b/src/main/kotlin/io/appwrite/enums/Runtime.kt index 02691dc..c19f52b 100644 --- a/src/main/kotlin/io/appwrite/enums/Runtime.kt +++ b/src/main/kotlin/io/appwrite/enums/Runtime.kt @@ -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") @@ -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") @@ -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") @@ -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 } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/AttributeBoolean.kt b/src/main/kotlin/io/appwrite/models/AttributeBoolean.kt index 55962c4..2f8477c 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeBoolean.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeBoolean.kt @@ -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. */ @@ -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, ) @@ -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?, ) } diff --git a/src/main/kotlin/io/appwrite/models/AttributeDatetime.kt b/src/main/kotlin/io/appwrite/models/AttributeDatetime.kt index 0a54b9d..8ae71ef 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeDatetime.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeDatetime.kt @@ -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. */ @@ -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, ) @@ -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?, ) diff --git a/src/main/kotlin/io/appwrite/models/AttributeEmail.kt b/src/main/kotlin/io/appwrite/models/AttributeEmail.kt index b7b0fbf..87bd1b3 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeEmail.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeEmail.kt @@ -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. */ @@ -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, ) @@ -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?, ) diff --git a/src/main/kotlin/io/appwrite/models/AttributeEnum.kt b/src/main/kotlin/io/appwrite/models/AttributeEnum.kt index db002d1..c8af621 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeEnum.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeEnum.kt @@ -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. @@ -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, @@ -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?, ) diff --git a/src/main/kotlin/io/appwrite/models/AttributeFloat.kt b/src/main/kotlin/io/appwrite/models/AttributeFloat.kt index 7c6250e..0e8d549 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeFloat.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeFloat.kt @@ -43,6 +43,18 @@ data class AttributeFloat( @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, + /** * Minimum value to enforce for new documents. */ @@ -69,6 +81,8 @@ data class AttributeFloat( "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, "min" to min as Any, "max" to max as Any, "default" to default as Any, @@ -86,6 +100,8 @@ data class AttributeFloat( 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, min = (map["min"] as? Number)?.toDouble(), max = (map["max"] as? Number)?.toDouble(), default = (map["default"] as? Number)?.toDouble(), diff --git a/src/main/kotlin/io/appwrite/models/AttributeInteger.kt b/src/main/kotlin/io/appwrite/models/AttributeInteger.kt index eb35f58..327bd9f 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeInteger.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeInteger.kt @@ -43,6 +43,18 @@ data class AttributeInteger( @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, + /** * Minimum value to enforce for new documents. */ @@ -69,6 +81,8 @@ data class AttributeInteger( "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, "min" to min as Any, "max" to max as Any, "default" to default as Any, @@ -86,6 +100,8 @@ data class AttributeInteger( 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, min = (map["min"] as? Number)?.toLong(), max = (map["max"] as? Number)?.toLong(), default = (map["default"] as? Number)?.toLong(), diff --git a/src/main/kotlin/io/appwrite/models/AttributeIp.kt b/src/main/kotlin/io/appwrite/models/AttributeIp.kt index 0deab91..b366ff2 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeIp.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeIp.kt @@ -43,6 +43,18 @@ data class AttributeIp( @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. */ @@ -63,6 +75,8 @@ data class AttributeIp( "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, ) @@ -79,6 +93,8 @@ data class AttributeIp( 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?, ) diff --git a/src/main/kotlin/io/appwrite/models/AttributeRelationship.kt b/src/main/kotlin/io/appwrite/models/AttributeRelationship.kt index e65f577..a03def7 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeRelationship.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeRelationship.kt @@ -43,6 +43,18 @@ data class AttributeRelationship( @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, + /** * The ID of the related collection. */ @@ -87,6 +99,8 @@ data class AttributeRelationship( "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, "relatedCollection" to relatedCollection as Any, "relationType" to relationType as Any, "twoWay" to twoWay as Any, @@ -107,6 +121,8 @@ data class AttributeRelationship( 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, relatedCollection = map["relatedCollection"] as String, relationType = map["relationType"] as String, twoWay = map["twoWay"] as Boolean, diff --git a/src/main/kotlin/io/appwrite/models/AttributeString.kt b/src/main/kotlin/io/appwrite/models/AttributeString.kt index 898c2b3..efae2ba 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeString.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeString.kt @@ -43,6 +43,18 @@ data class AttributeString( @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, + /** * Attribute size. */ @@ -63,6 +75,8 @@ data class AttributeString( "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, "size" to size as Any, "default" to default as Any, ) @@ -79,6 +93,8 @@ data class AttributeString( 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, size = (map["size"] as Number).toLong(), default = map["default"] as? String?, ) diff --git a/src/main/kotlin/io/appwrite/models/AttributeUrl.kt b/src/main/kotlin/io/appwrite/models/AttributeUrl.kt index 53b5434..d29ba7e 100644 --- a/src/main/kotlin/io/appwrite/models/AttributeUrl.kt +++ b/src/main/kotlin/io/appwrite/models/AttributeUrl.kt @@ -43,6 +43,18 @@ data class AttributeUrl( @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. */ @@ -63,6 +75,8 @@ data class AttributeUrl( "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, ) @@ -79,6 +93,8 @@ data class AttributeUrl( 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?, ) diff --git a/src/main/kotlin/io/appwrite/models/Bucket.kt b/src/main/kotlin/io/appwrite/models/Bucket.kt index 25891cd..9faeb35 100644 --- a/src/main/kotlin/io/appwrite/models/Bucket.kt +++ b/src/main/kotlin/io/appwrite/models/Bucket.kt @@ -29,7 +29,7 @@ data class Bucket( * Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ @SerializedName("\$permissions") - val permissions: List<Any>, + val permissions: List<String>, /** * Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). @@ -59,7 +59,7 @@ data class Bucket( * Allowed file extensions. */ @SerializedName("allowedFileExtensions") - val allowedFileExtensions: List<Any>, + val allowedFileExtensions: List<String>, /** * Compression algorithm choosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). @@ -104,12 +104,12 @@ data class Bucket( id = map["\$id"] as String, createdAt = map["\$createdAt"] as String, updatedAt = map["\$updatedAt"] as String, - permissions = map["\$permissions"] as List<Any>, + permissions = map["\$permissions"] as List<String>, fileSecurity = map["fileSecurity"] as Boolean, name = map["name"] as String, enabled = map["enabled"] as Boolean, maximumFileSize = (map["maximumFileSize"] as Number).toLong(), - allowedFileExtensions = map["allowedFileExtensions"] as List<Any>, + allowedFileExtensions = map["allowedFileExtensions"] as List<String>, compression = map["compression"] as String, encryption = map["encryption"] as Boolean, antivirus = map["antivirus"] as Boolean, diff --git a/src/main/kotlin/io/appwrite/models/Collection.kt b/src/main/kotlin/io/appwrite/models/Collection.kt index bf4699d..56b7b41 100644 --- a/src/main/kotlin/io/appwrite/models/Collection.kt +++ b/src/main/kotlin/io/appwrite/models/Collection.kt @@ -29,7 +29,7 @@ data class Collection( * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ @SerializedName("\$permissions") - val permissions: List<Any>, + val permissions: List<String>, /** * Database ID. @@ -90,7 +90,7 @@ data class Collection( id = map["\$id"] as String, createdAt = map["\$createdAt"] as String, updatedAt = map["\$updatedAt"] as String, - permissions = map["\$permissions"] as List<Any>, + permissions = map["\$permissions"] as List<String>, databaseId = map["databaseId"] as String, name = map["name"] as String, enabled = map["enabled"] as Boolean, diff --git a/src/main/kotlin/io/appwrite/models/Document.kt b/src/main/kotlin/io/appwrite/models/Document.kt index 5a7d371..01204de 100644 --- a/src/main/kotlin/io/appwrite/models/Document.kt +++ b/src/main/kotlin/io/appwrite/models/Document.kt @@ -41,7 +41,7 @@ data class Document<T>( * Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ @SerializedName("\$permissions") - val permissions: List<Any>, + val permissions: List<String>, /** * Additional properties @@ -66,7 +66,7 @@ data class Document<T>( databaseId: String, createdAt: String, updatedAt: String, - permissions: List<Any>, + permissions: List<String>, data: Map<String, Any> ) = Document<Map<String, Any>>( id, @@ -88,7 +88,7 @@ data class Document<T>( databaseId = map["\$databaseId"] as String, createdAt = map["\$createdAt"] as String, updatedAt = map["\$updatedAt"] as String, - permissions = map["\$permissions"] as List<Any>, + permissions = map["\$permissions"] as List<String>, data = map.jsonCast(to = nestedType) ) } diff --git a/src/main/kotlin/io/appwrite/models/Execution.kt b/src/main/kotlin/io/appwrite/models/Execution.kt index 44724fa..1b6226a 100644 --- a/src/main/kotlin/io/appwrite/models/Execution.kt +++ b/src/main/kotlin/io/appwrite/models/Execution.kt @@ -29,7 +29,7 @@ data class Execution( * Execution roles. */ @SerializedName("\$permissions") - val permissions: List<Any>, + val permissions: List<String>, /** * Function ID. @@ -139,7 +139,7 @@ data class Execution( id = map["\$id"] as String, createdAt = map["\$createdAt"] as String, updatedAt = map["\$updatedAt"] as String, - permissions = map["\$permissions"] as List<Any>, + permissions = map["\$permissions"] as List<String>, functionId = map["functionId"] as String, trigger = map["trigger"] as String, status = map["status"] as String, diff --git a/src/main/kotlin/io/appwrite/models/File.kt b/src/main/kotlin/io/appwrite/models/File.kt index 5c2b731..897fc4a 100644 --- a/src/main/kotlin/io/appwrite/models/File.kt +++ b/src/main/kotlin/io/appwrite/models/File.kt @@ -35,7 +35,7 @@ data class File( * File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ @SerializedName("\$permissions") - val permissions: List<Any>, + val permissions: List<String>, /** * File name. @@ -98,7 +98,7 @@ data class File( bucketId = map["bucketId"] as String, createdAt = map["\$createdAt"] as String, updatedAt = map["\$updatedAt"] as String, - permissions = map["\$permissions"] as List<Any>, + permissions = map["\$permissions"] as List<String>, name = map["name"] as String, signature = map["signature"] as String, mimeType = map["mimeType"] as String, diff --git a/src/main/kotlin/io/appwrite/models/Function.kt b/src/main/kotlin/io/appwrite/models/Function.kt index d46c936..bb1b50e 100644 --- a/src/main/kotlin/io/appwrite/models/Function.kt +++ b/src/main/kotlin/io/appwrite/models/Function.kt @@ -29,7 +29,7 @@ data class Function( * Execution permissions. */ @SerializedName("execute") - val execute: List<Any>, + val execute: List<String>, /** * Function name. @@ -71,7 +71,7 @@ data class Function( * Allowed permission scopes. */ @SerializedName("scopes") - val scopes: List<Any>, + val scopes: List<String>, /** * Function variables. @@ -83,10 +83,10 @@ data class Function( * Function trigger events. */ @SerializedName("events") - val events: List<Any>, + val events: List<String>, /** - * Function execution schedult in CRON format. + * Function execution schedule in CRON format. */ @SerializedName("schedule") val schedule: String, @@ -188,16 +188,16 @@ data class Function( id = map["\$id"] as String, createdAt = map["\$createdAt"] as String, updatedAt = map["\$updatedAt"] as String, - execute = map["execute"] as List<Any>, + execute = map["execute"] as List<String>, name = map["name"] as String, enabled = map["enabled"] as Boolean, live = map["live"] as Boolean, logging = map["logging"] as Boolean, runtime = map["runtime"] as String, deployment = map["deployment"] as String, - scopes = map["scopes"] as List<Any>, + scopes = map["scopes"] as List<String>, vars = (map["vars"] as List<Map<String, Any>>).map { Variable.from(map = it) }, - events = map["events"] as List<Any>, + events = map["events"] as List<String>, schedule = map["schedule"] as String, timeout = (map["timeout"] as Number).toLong(), entrypoint = map["entrypoint"] as String, diff --git a/src/main/kotlin/io/appwrite/models/Index.kt b/src/main/kotlin/io/appwrite/models/Index.kt index 88857da..c45e25f 100644 --- a/src/main/kotlin/io/appwrite/models/Index.kt +++ b/src/main/kotlin/io/appwrite/models/Index.kt @@ -35,13 +35,25 @@ data class Index( * Index attributes. */ @SerializedName("attributes") - val attributes: List<Any>, + val attributes: List<String>, /** * Index orders. */ @SerializedName("orders") - var orders: List<Any>?, + var orders: List<String>?, + + /** + * Index creation date in ISO 8601 format. + */ + @SerializedName("\$createdAt") + val createdAt: String, + + /** + * Index update date in ISO 8601 format. + */ + @SerializedName("\$updatedAt") + val updatedAt: String, ) { fun toMap(): Map<String, Any> = mapOf( @@ -51,6 +63,8 @@ data class Index( "error" to error as Any, "attributes" to attributes as Any, "orders" to orders as Any, + "\$createdAt" to createdAt as Any, + "\$updatedAt" to updatedAt as Any, ) companion object { @@ -63,8 +77,10 @@ data class Index( type = map["type"] as String, status = map["status"] as String, error = map["error"] as String, - attributes = map["attributes"] as List<Any>, - orders = map["orders"] as? List<Any>?, + attributes = map["attributes"] as List<String>, + orders = map["orders"] as? List<String>?, + createdAt = map["\$createdAt"] as String, + updatedAt = map["\$updatedAt"] as String, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Membership.kt b/src/main/kotlin/io/appwrite/models/Membership.kt index 17ab303..4a899ee 100644 --- a/src/main/kotlin/io/appwrite/models/Membership.kt +++ b/src/main/kotlin/io/appwrite/models/Membership.kt @@ -32,13 +32,13 @@ data class Membership( val userId: String, /** - * User name. + * User name. Hide this attribute by toggling membership privacy in the Console. */ @SerializedName("userName") val userName: String, /** - * User email address. + * User email address. Hide this attribute by toggling membership privacy in the Console. */ @SerializedName("userEmail") val userEmail: String, @@ -74,7 +74,7 @@ data class Membership( val confirm: Boolean, /** - * Multi factor authentication status, true if the user has MFA enabled or false otherwise. + * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. */ @SerializedName("mfa") val mfa: Boolean, @@ -83,7 +83,7 @@ data class Membership( * User list of roles */ @SerializedName("roles") - val roles: List<Any>, + val roles: List<String>, ) { fun toMap(): Map<String, Any> = mapOf( @@ -120,7 +120,7 @@ data class Membership( joined = map["joined"] as String, confirm = map["confirm"] as Boolean, mfa = map["mfa"] as Boolean, - roles = map["roles"] as List<Any>, + roles = map["roles"] as List<String>, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Message.kt b/src/main/kotlin/io/appwrite/models/Message.kt index 4550dd5..e5509c1 100644 --- a/src/main/kotlin/io/appwrite/models/Message.kt +++ b/src/main/kotlin/io/appwrite/models/Message.kt @@ -35,19 +35,19 @@ data class Message( * Topic IDs set as recipients. */ @SerializedName("topics") - val topics: List<Any>, + val topics: List<String>, /** * User IDs set as recipients. */ @SerializedName("users") - val users: List<Any>, + val users: List<String>, /** * Target IDs set as recipients. */ @SerializedName("targets") - val targets: List<Any>, + val targets: List<String>, /** * The scheduled time for message. @@ -65,7 +65,7 @@ data class Message( * Delivery errors if any. */ @SerializedName("deliveryErrors") - var deliveryErrors: List<Any>?, + var deliveryErrors: List<String>?, /** * Number of recipients the message was delivered to. @@ -112,12 +112,12 @@ data class Message( createdAt = map["\$createdAt"] as String, updatedAt = map["\$updatedAt"] as String, providerType = map["providerType"] as String, - topics = map["topics"] as List<Any>, - users = map["users"] as List<Any>, - targets = map["targets"] as List<Any>, + topics = map["topics"] as List<String>, + users = map["users"] as List<String>, + targets = map["targets"] as List<String>, scheduledAt = map["scheduledAt"] as? String?, deliveredAt = map["deliveredAt"] as? String?, - deliveryErrors = map["deliveryErrors"] as? List<Any>?, + deliveryErrors = map["deliveryErrors"] as? List<String>?, deliveredTotal = (map["deliveredTotal"] as Number).toLong(), data = map["data"] as Any, status = map["status"] as String, diff --git a/src/main/kotlin/io/appwrite/models/MfaRecoveryCodes.kt b/src/main/kotlin/io/appwrite/models/MfaRecoveryCodes.kt index ad8bc45..3fab41a 100644 --- a/src/main/kotlin/io/appwrite/models/MfaRecoveryCodes.kt +++ b/src/main/kotlin/io/appwrite/models/MfaRecoveryCodes.kt @@ -11,7 +11,7 @@ data class MfaRecoveryCodes( * Recovery codes. */ @SerializedName("recoveryCodes") - val recoveryCodes: List<Any>, + val recoveryCodes: List<String>, ) { fun toMap(): Map<String, Any> = mapOf( @@ -24,7 +24,7 @@ data class MfaRecoveryCodes( fun from( map: Map<String, Any>, ) = MfaRecoveryCodes( - recoveryCodes = map["recoveryCodes"] as List<Any>, + recoveryCodes = map["recoveryCodes"] as List<String>, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Runtime.kt b/src/main/kotlin/io/appwrite/models/Runtime.kt index e4261e0..79c5b6b 100644 --- a/src/main/kotlin/io/appwrite/models/Runtime.kt +++ b/src/main/kotlin/io/appwrite/models/Runtime.kt @@ -53,7 +53,7 @@ data class Runtime( * List of supported architectures. */ @SerializedName("supports") - val supports: List<Any>, + val supports: List<String>, ) { fun toMap(): Map<String, Any> = mapOf( @@ -80,7 +80,7 @@ data class Runtime( base = map["base"] as String, image = map["image"] as String, logo = map["logo"] as String, - supports = map["supports"] as List<Any>, + supports = map["supports"] as List<String>, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Session.kt b/src/main/kotlin/io/appwrite/models/Session.kt index 1c6a7b2..02dbb28 100644 --- a/src/main/kotlin/io/appwrite/models/Session.kt +++ b/src/main/kotlin/io/appwrite/models/Session.kt @@ -167,7 +167,7 @@ data class Session( * Returns a list of active session factors. */ @SerializedName("factors") - val factors: List<Any>, + val factors: List<String>, /** * Secret used to authenticate the user. Only included if the request was made with an API key @@ -246,7 +246,7 @@ data class Session( countryCode = map["countryCode"] as String, countryName = map["countryName"] as String, current = map["current"] as Boolean, - factors = map["factors"] as List<Any>, + factors = map["factors"] as List<String>, secret = map["secret"] as String, mfaUpdatedAt = map["mfaUpdatedAt"] as String, ) diff --git a/src/main/kotlin/io/appwrite/models/Target.kt b/src/main/kotlin/io/appwrite/models/Target.kt index bd4d207..54b4694 100644 --- a/src/main/kotlin/io/appwrite/models/Target.kt +++ b/src/main/kotlin/io/appwrite/models/Target.kt @@ -55,6 +55,12 @@ data class Target( @SerializedName("identifier") val identifier: String, + /** + * Is the target expired. + */ + @SerializedName("expired") + val expired: Boolean, + ) { fun toMap(): Map<String, Any> = mapOf( "\$id" to id as Any, @@ -65,6 +71,7 @@ data class Target( "providerId" to providerId as Any, "providerType" to providerType as Any, "identifier" to identifier as Any, + "expired" to expired as Any, ) companion object { @@ -81,6 +88,7 @@ data class Target( providerId = map["providerId"] as? String?, providerType = map["providerType"] as String, identifier = map["identifier"] as String, + expired = map["expired"] as Boolean, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/Topic.kt b/src/main/kotlin/io/appwrite/models/Topic.kt index 82f59f1..accfbff 100644 --- a/src/main/kotlin/io/appwrite/models/Topic.kt +++ b/src/main/kotlin/io/appwrite/models/Topic.kt @@ -53,7 +53,7 @@ data class Topic( * Subscribe permissions. */ @SerializedName("subscribe") - val subscribe: List<Any>, + val subscribe: List<String>, ) { fun toMap(): Map<String, Any> = mapOf( @@ -80,7 +80,7 @@ data class Topic( emailTotal = (map["emailTotal"] as Number).toLong(), smsTotal = (map["smsTotal"] as Number).toLong(), pushTotal = (map["pushTotal"] as Number).toLong(), - subscribe = map["subscribe"] as List<Any>, + subscribe = map["subscribe"] as List<String>, ) } } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/models/User.kt b/src/main/kotlin/io/appwrite/models/User.kt index 095467a..fd03fc2 100644 --- a/src/main/kotlin/io/appwrite/models/User.kt +++ b/src/main/kotlin/io/appwrite/models/User.kt @@ -65,7 +65,7 @@ data class User<T>( * Labels for the user. */ @SerializedName("labels") - val labels: List<Any>, + val labels: List<String>, /** * Password update time in ISO 8601 format. @@ -155,7 +155,7 @@ data class User<T>( hashOptions: Any?, registration: String, status: Boolean, - labels: List<Any>, + labels: List<String>, passwordUpdate: String, email: String, phone: String, @@ -201,7 +201,7 @@ data class User<T>( hashOptions = map["hashOptions"] as? Any?, registration = map["registration"] as String, status = map["status"] as Boolean, - labels = map["labels"] as List<Any>, + labels = map["labels"] as List<String>, passwordUpdate = map["passwordUpdate"] as String, email = map["email"] as String, phone = map["phone"] as String, diff --git a/src/main/kotlin/io/appwrite/services/Account.kt b/src/main/kotlin/io/appwrite/services/Account.kt index debf675..aaa851c 100644 --- a/src/main/kotlin/io/appwrite/services/Account.kt +++ b/src/main/kotlin/io/appwrite/services/Account.kt @@ -184,7 +184,7 @@ class Account(client: Client) : Service(client) { ) /** - * List Identities + * List identities * * Get the list of identities for the currently logged in user. * @@ -361,7 +361,7 @@ class Account(client: Client) : Service(client) { ) /** - * Create Authenticator + * Create authenticator * * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. * @@ -394,7 +394,7 @@ class Account(client: Client) : Service(client) { } /** - * Verify Authenticator + * Verify authenticator * * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * @@ -431,7 +431,7 @@ class Account(client: Client) : Service(client) { } /** - * Verify Authenticator + * Verify authenticator * * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * @@ -450,7 +450,7 @@ class Account(client: Client) : Service(client) { ) /** - * Delete Authenticator + * Delete authenticator * * Delete an authenticator for a user by ID. * @@ -479,7 +479,7 @@ class Account(client: Client) : Service(client) { } /** - * Create MFA Challenge + * Create MFA challenge * * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * @@ -512,7 +512,7 @@ class Account(client: Client) : Service(client) { } /** - * Create MFA Challenge (confirmation) + * Create MFA challenge (confirmation) * * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * @@ -544,7 +544,7 @@ class Account(client: Client) : Service(client) { } /** - * List Factors + * List factors * * List the factors available on the account to be used as a MFA challange. * @@ -574,7 +574,7 @@ class Account(client: Client) : Service(client) { } /** - * Get MFA Recovery Codes + * Get MFA recovery codes * * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. * @@ -604,7 +604,7 @@ class Account(client: Client) : Service(client) { } /** - * Create MFA Recovery Codes + * Create MFA recovery codes * * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * @@ -634,7 +634,7 @@ class Account(client: Client) : Service(client) { } /** - * Regenerate MFA Recovery Codes + * Regenerate MFA recovery codes * * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. * @@ -1408,7 +1408,7 @@ class Account(client: Client) : Service(client) { /** * Create magic URL token * - * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * * @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param email User email. diff --git a/src/main/kotlin/io/appwrite/services/Locale.kt b/src/main/kotlin/io/appwrite/services/Locale.kt index 8059629..170fd8b 100644 --- a/src/main/kotlin/io/appwrite/services/Locale.kt +++ b/src/main/kotlin/io/appwrite/services/Locale.kt @@ -44,7 +44,7 @@ class Locale(client: Client) : Service(client) { } /** - * List Locale Codes + * List locale codes * * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). * diff --git a/src/main/kotlin/io/appwrite/services/Messaging.kt b/src/main/kotlin/io/appwrite/services/Messaging.kt index 5701692..be6c259 100644 --- a/src/main/kotlin/io/appwrite/services/Messaging.kt +++ b/src/main/kotlin/io/appwrite/services/Messaging.kt @@ -195,24 +195,27 @@ class Messaging(client: Client) : Service(client) { * @param topics List of Topic IDs. * @param users List of User IDs. * @param targets List of Targets IDs. - * @param data Additional Data for push notification. + * @param data Additional key-value pair data for push notification. * @param action Action for push notification. * @param image Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. * @param icon Icon for push notification. Available only for Android and Web Platform. - * @param sound Sound for push notification. Available only for Android and IOS Platform. + * @param sound Sound for push notification. Available only for Android and iOS Platform. * @param color Color for push notification. Available only for Android Platform. * @param tag Tag for push notification. Available only for Android Platform. - * @param badge Badge for push notification. Available only for IOS Platform. + * @param badge Badge for push notification. Available only for iOS Platform. * @param draft Is message a draft * @param scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + * @param contentAvailable If set to true, the notification will be delivered in the background. Available only for iOS Platform. + * @param critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. + * @param priority Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification. * @return [io.appwrite.models.Message] */ @JvmOverloads @Throws(AppwriteException::class) suspend fun createPush( messageId: String, - title: String, - body: String, + title: String? = null, + body: String? = null, topics: List<String>? = null, users: List<String>? = null, targets: List<String>? = null, @@ -223,9 +226,12 @@ class Messaging(client: Client) : Service(client) { sound: String? = null, color: String? = null, tag: String? = null, - badge: String? = null, + badge: Long? = null, draft: Boolean? = null, scheduledAt: String? = null, + contentAvailable: Boolean? = null, + critical: Boolean? = null, + priority: io.appwrite.enums.MessagePriority? = null, ): io.appwrite.models.Message { val apiPath = "/messaging/messages/push" @@ -246,6 +252,9 @@ class Messaging(client: Client) : Service(client) { "badge" to badge, "draft" to draft, "scheduledAt" to scheduledAt, + "contentAvailable" to contentAvailable, + "critical" to critical, + "priority" to priority, ) val apiHeaders = mutableMapOf( "content-type" to "application/json", @@ -284,6 +293,9 @@ class Messaging(client: Client) : Service(client) { * @param badge Badge for push notification. Available only for iOS platforms. * @param draft Is message a draft * @param scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. + * @param contentAvailable If set to true, the notification will be delivered in the background. Available only for iOS Platform. + * @param critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. + * @param priority Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. * @return [io.appwrite.models.Message] */ @JvmOverloads @@ -305,6 +317,9 @@ class Messaging(client: Client) : Service(client) { badge: Long? = null, draft: Boolean? = null, scheduledAt: String? = null, + contentAvailable: Boolean? = null, + critical: Boolean? = null, + priority: io.appwrite.enums.MessagePriority? = null, ): io.appwrite.models.Message { val apiPath = "/messaging/messages/push/{messageId}" .replace("{messageId}", messageId) @@ -325,6 +340,9 @@ class Messaging(client: Client) : Service(client) { "badge" to badge, "draft" to draft, "scheduledAt" to scheduledAt, + "contentAvailable" to contentAvailable, + "critical" to critical, + "priority" to priority, ) val apiHeaders = mutableMapOf( "content-type" to "application/json", diff --git a/src/main/kotlin/io/appwrite/services/Storage.kt b/src/main/kotlin/io/appwrite/services/Storage.kt index 1a69af2..5a10935 100644 --- a/src/main/kotlin/io/appwrite/services/Storage.kt +++ b/src/main/kotlin/io/appwrite/services/Storage.kt @@ -404,7 +404,7 @@ class Storage(client: Client) : Service(client) { } /** - * Delete File + * Delete file * * Delete a file by its unique ID. Only users with write permissions have access to delete this resource. * diff --git a/src/main/kotlin/io/appwrite/services/Teams.kt b/src/main/kotlin/io/appwrite/services/Teams.kt index f102654..aa355dc 100644 --- a/src/main/kotlin/io/appwrite/services/Teams.kt +++ b/src/main/kotlin/io/appwrite/services/Teams.kt @@ -273,7 +273,7 @@ class Teams(client: Client) : Service(client) { /** * List team memberships * - * Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. + * Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. * * @param teamId Team ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm @@ -365,7 +365,7 @@ class Teams(client: Client) : Service(client) { /** * Get team membership * - * Get a team member by the membership unique id. All team members have read access for this resource. + * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. * * @param teamId Team ID. * @param membershipId Membership ID. diff --git a/src/main/kotlin/io/appwrite/services/Users.kt b/src/main/kotlin/io/appwrite/services/Users.kt index 8f4ff00..28c3cf3 100644 --- a/src/main/kotlin/io/appwrite/services/Users.kt +++ b/src/main/kotlin/io/appwrite/services/Users.kt @@ -288,7 +288,7 @@ class Users(client: Client) : Service(client) { ) /** - * List Identities + * List identities * * Get identities for all users. * @@ -1115,7 +1115,7 @@ class Users(client: Client) : Service(client) { ) /** - * Delete Authenticator + * Delete authenticator * * Delete an authenticator app. * @@ -1152,7 +1152,7 @@ class Users(client: Client) : Service(client) { } /** - * Delete Authenticator + * Delete authenticator * * Delete an authenticator app. * @@ -1171,7 +1171,7 @@ class Users(client: Client) : Service(client) { ) /** - * List Factors + * List factors * * List the factors available on the account to be used as a MFA challange. * @@ -1204,7 +1204,7 @@ class Users(client: Client) : Service(client) { } /** - * Get MFA Recovery Codes + * Get MFA recovery codes * * Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. * @@ -1237,7 +1237,7 @@ class Users(client: Client) : Service(client) { } /** - * Regenerate MFA Recovery Codes + * Regenerate MFA recovery codes * * Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. * @@ -1270,7 +1270,7 @@ class Users(client: Client) : Service(client) { } /** - * Create MFA Recovery Codes + * Create MFA recovery codes * * Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. * @@ -1760,7 +1760,7 @@ class Users(client: Client) : Service(client) { ) /** - * List User Targets + * List user targets * * List the messaging targets that are associated with a user. * @@ -1797,7 +1797,7 @@ class Users(client: Client) : Service(client) { } /** - * Create User Target + * Create user target * * Create a messaging target. * @@ -1846,7 +1846,7 @@ class Users(client: Client) : Service(client) { } /** - * Get User Target + * Get user target * * Get a user's push notification target by ID. * @@ -1882,7 +1882,7 @@ class Users(client: Client) : Service(client) { } /** - * Update User target + * Update user target * * Update a messaging target. *