Skip to content

Commit aa6d3ba

Browse files
committed
chore: update title and desc
1 parent 4db0f4d commit aa6d3ba

18 files changed

+90
-46
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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:11.2.0")
42+
implementation("io.appwrite:sdk-for-kotlin:12.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>11.2.0</version>
53+
<version>12.0.0</version>
5454
</dependency>
5555
</dependencies>
5656
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class Client @JvmOverloads constructor(
5858
init {
5959
headers = mutableMapOf(
6060
"content-type" to "application/json",
61-
"user-agent" to "AppwriteKotlinSDK/11.2.0 ${System.getProperty("http.agent")}",
61+
"user-agent" to "AppwriteKotlinSDK/12.0.0 ${System.getProperty("http.agent")}",
6262
"x-sdk-name" to "Kotlin",
6363
"x-sdk-platform" to "server",
6464
"x-sdk-language" to "kotlin",
65-
"x-sdk-version" to "11.2.0",
65+
"x-sdk-version" to "12.0.0",
6666
"x-appwrite-response-format" to "1.8.0",
6767
)
6868

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package io.appwrite.enums
2+
3+
import com.google.gson.annotations.SerializedName
4+
5+
enum class ColumnStatus(val value: String) {
6+
@SerializedName("available")
7+
AVAILABLE("available"),
8+
@SerializedName("processing")
9+
PROCESSING("processing"),
10+
@SerializedName("deleting")
11+
DELETING("deleting"),
12+
@SerializedName("stuck")
13+
STUCK("stuck"),
14+
@SerializedName("failed")
15+
FAILED("failed");
16+
17+
override fun toString() = value
18+
}
Lines changed: 12 additions & 0 deletions
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 DatabaseType(val value: String) {
6+
@SerializedName("legacy")
7+
LEGACY("legacy"),
8+
@SerializedName("tablesdb")
9+
TABLESDB("tablesdb");
10+
11+
override fun toString() = value
12+
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.appwrite.models
22

33
import com.google.gson.annotations.SerializedName
44
import io.appwrite.extensions.jsonCast
5+
import io.appwrite.enums.ColumnStatus
56

67
/**
78
* ColumnBoolean
@@ -23,7 +24,7 @@ data class ColumnBoolean(
2324
* Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
2425
*/
2526
@SerializedName("status")
26-
val status: String,
27+
val status: ColumnStatus,
2728

2829
/**
2930
* Error message. Displays error generated on failure of creating or deleting an column.
@@ -65,7 +66,7 @@ data class ColumnBoolean(
6566
fun toMap(): Map<String, Any> = mapOf(
6667
"key" to key as Any,
6768
"type" to type as Any,
68-
"status" to status as Any,
69+
"status" to status.value as Any,
6970
"error" to error as Any,
7071
"required" to required as Any,
7172
"array" to array as Any,
@@ -82,7 +83,7 @@ data class ColumnBoolean(
8283
) = ColumnBoolean(
8384
key = map["key"] as String,
8485
type = map["type"] as String,
85-
status = map["status"] as String,
86+
status = ColumnStatus.values().find { it.value == map["status"] as String }!!,
8687
error = map["error"] as String,
8788
required = map["required"] as Boolean,
8889
array = map["array"] as? Boolean,

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.appwrite.models
22

33
import com.google.gson.annotations.SerializedName
44
import io.appwrite.extensions.jsonCast
5+
import io.appwrite.enums.ColumnStatus
56

67
/**
78
* ColumnDatetime
@@ -23,7 +24,7 @@ data class ColumnDatetime(
2324
* Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
2425
*/
2526
@SerializedName("status")
26-
val status: String,
27+
val status: ColumnStatus,
2728

2829
/**
2930
* Error message. Displays error generated on failure of creating or deleting an column.
@@ -71,7 +72,7 @@ data class ColumnDatetime(
7172
fun toMap(): Map<String, Any> = mapOf(
7273
"key" to key as Any,
7374
"type" to type as Any,
74-
"status" to status as Any,
75+
"status" to status.value as Any,
7576
"error" to error as Any,
7677
"required" to required as Any,
7778
"array" to array as Any,
@@ -89,7 +90,7 @@ data class ColumnDatetime(
8990
) = ColumnDatetime(
9091
key = map["key"] as String,
9192
type = map["type"] as String,
92-
status = map["status"] as String,
93+
status = ColumnStatus.values().find { it.value == map["status"] as String }!!,
9394
error = map["error"] as String,
9495
required = map["required"] as Boolean,
9596
array = map["array"] as? Boolean,

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.appwrite.models
22

33
import com.google.gson.annotations.SerializedName
44
import io.appwrite.extensions.jsonCast
5+
import io.appwrite.enums.ColumnStatus
56

67
/**
78
* ColumnEmail
@@ -23,7 +24,7 @@ data class ColumnEmail(
2324
* Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
2425
*/
2526
@SerializedName("status")
26-
val status: String,
27+
val status: ColumnStatus,
2728

2829
/**
2930
* Error message. Displays error generated on failure of creating or deleting an column.
@@ -71,7 +72,7 @@ data class ColumnEmail(
7172
fun toMap(): Map<String, Any> = mapOf(
7273
"key" to key as Any,
7374
"type" to type as Any,
74-
"status" to status as Any,
75+
"status" to status.value as Any,
7576
"error" to error as Any,
7677
"required" to required as Any,
7778
"array" to array as Any,
@@ -89,7 +90,7 @@ data class ColumnEmail(
8990
) = ColumnEmail(
9091
key = map["key"] as String,
9192
type = map["type"] as String,
92-
status = map["status"] as String,
93+
status = ColumnStatus.values().find { it.value == map["status"] as String }!!,
9394
error = map["error"] as String,
9495
required = map["required"] as Boolean,
9596
array = map["array"] as? Boolean,

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.appwrite.models
22

33
import com.google.gson.annotations.SerializedName
44
import io.appwrite.extensions.jsonCast
5+
import io.appwrite.enums.ColumnStatus
56

67
/**
78
* ColumnEnum
@@ -23,7 +24,7 @@ data class ColumnEnum(
2324
* Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
2425
*/
2526
@SerializedName("status")
26-
val status: String,
27+
val status: ColumnStatus,
2728

2829
/**
2930
* Error message. Displays error generated on failure of creating or deleting an column.
@@ -77,7 +78,7 @@ data class ColumnEnum(
7778
fun toMap(): Map<String, Any> = mapOf(
7879
"key" to key as Any,
7980
"type" to type as Any,
80-
"status" to status as Any,
81+
"status" to status.value as Any,
8182
"error" to error as Any,
8283
"required" to required as Any,
8384
"array" to array as Any,
@@ -96,7 +97,7 @@ data class ColumnEnum(
9697
) = ColumnEnum(
9798
key = map["key"] as String,
9899
type = map["type"] as String,
99-
status = map["status"] as String,
100+
status = ColumnStatus.values().find { it.value == map["status"] as String }!!,
100101
error = map["error"] as String,
101102
required = map["required"] as Boolean,
102103
array = map["array"] as? Boolean,

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.appwrite.models
22

33
import com.google.gson.annotations.SerializedName
44
import io.appwrite.extensions.jsonCast
5+
import io.appwrite.enums.ColumnStatus
56

67
/**
78
* ColumnFloat
@@ -23,7 +24,7 @@ data class ColumnFloat(
2324
* Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
2425
*/
2526
@SerializedName("status")
26-
val status: String,
27+
val status: ColumnStatus,
2728

2829
/**
2930
* Error message. Displays error generated on failure of creating or deleting an column.
@@ -77,7 +78,7 @@ data class ColumnFloat(
7778
fun toMap(): Map<String, Any> = mapOf(
7879
"key" to key as Any,
7980
"type" to type as Any,
80-
"status" to status as Any,
81+
"status" to status.value as Any,
8182
"error" to error as Any,
8283
"required" to required as Any,
8384
"array" to array as Any,
@@ -96,7 +97,7 @@ data class ColumnFloat(
9697
) = ColumnFloat(
9798
key = map["key"] as String,
9899
type = map["type"] as String,
99-
status = map["status"] as String,
100+
status = ColumnStatus.values().find { it.value == map["status"] as String }!!,
100101
error = map["error"] as String,
101102
required = map["required"] as Boolean,
102103
array = map["array"] as? Boolean,

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.appwrite.models
22

33
import com.google.gson.annotations.SerializedName
44
import io.appwrite.extensions.jsonCast
5+
import io.appwrite.enums.ColumnStatus
56

67
/**
78
* ColumnInteger
@@ -23,7 +24,7 @@ data class ColumnInteger(
2324
* Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
2425
*/
2526
@SerializedName("status")
26-
val status: String,
27+
val status: ColumnStatus,
2728

2829
/**
2930
* Error message. Displays error generated on failure of creating or deleting an column.
@@ -77,7 +78,7 @@ data class ColumnInteger(
7778
fun toMap(): Map<String, Any> = mapOf(
7879
"key" to key as Any,
7980
"type" to type as Any,
80-
"status" to status as Any,
81+
"status" to status.value as Any,
8182
"error" to error as Any,
8283
"required" to required as Any,
8384
"array" to array as Any,
@@ -96,7 +97,7 @@ data class ColumnInteger(
9697
) = ColumnInteger(
9798
key = map["key"] as String,
9899
type = map["type"] as String,
99-
status = map["status"] as String,
100+
status = ColumnStatus.values().find { it.value == map["status"] as String }!!,
100101
error = map["error"] as String,
101102
required = map["required"] as Boolean,
102103
array = map["array"] as? Boolean,

0 commit comments

Comments
 (0)