@@ -2,6 +2,7 @@ package io.appwrite.models
2
2
3
3
import com.google.gson.annotations.SerializedName
4
4
import io.appwrite.extensions.jsonCast
5
+ import io.appwrite.enums.ColumnStatus
5
6
6
7
/* *
7
8
* ColumnDatetime
@@ -23,7 +24,7 @@ data class ColumnDatetime(
23
24
* Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
24
25
*/
25
26
@SerializedName(" status" )
26
- val status : String ,
27
+ val status : ColumnStatus ,
27
28
28
29
/* *
29
30
* Error message. Displays error generated on failure of creating or deleting an column.
@@ -71,7 +72,7 @@ data class ColumnDatetime(
71
72
fun toMap (): Map <String , Any > = mapOf (
72
73
" key" to key as Any ,
73
74
" type" to type as Any ,
74
- " status" to status as Any ,
75
+ " status" to status.value as Any ,
75
76
" error" to error as Any ,
76
77
" required" to required as Any ,
77
78
" array" to array as Any ,
@@ -89,7 +90,7 @@ data class ColumnDatetime(
89
90
) = ColumnDatetime (
90
91
key = map[" key" ] as String ,
91
92
type = map[" type" ] as String ,
92
- status = map[" status" ] as String ,
93
+ status = ColumnStatus .values().find { it.value == map[" status" ] as String } !! ,
93
94
error = map[" error" ] as String ,
94
95
required = map[" required" ] as Boolean ,
95
96
array = map[" array" ] as ? Boolean ,
0 commit comments