Skip to content

Commit 4b0ffa6

Browse files
committed
Appwrite 1.5 support
1 parent d8096dc commit 4b0ffa6

File tree

9 files changed

+32
-30
lines changed

9 files changed

+32
-30
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ class Client @JvmOverloads constructor(
6161
"x-sdk-name" to "Kotlin",
6262
"x-sdk-platform" to "server",
6363
"x-sdk-language" to "kotlin",
64-
"x-sdk-version" to "5.0.0", "x-appwrite-response-format" to "1.5.0"
64+
"x-sdk-version" to "5.0.0",
65+
"x-appwrite-response-format" to "1.5.0",
6566
)
67+
6668
config = mutableMapOf()
6769

6870
setSelfSigned(selfSigned)

src/main/kotlin/io/appwrite/services/Account.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class Account(client: Client) : Service(client) {
370370
*/
371371
@Throws(AppwriteException::class)
372372
suspend fun createMfaAuthenticator(
373-
type: AuthenticatorType,
373+
type: io.appwrite.enums.AuthenticatorType,
374374
): io.appwrite.models.MfaType {
375375
val apiPath = "/account/mfa/authenticators/{type}"
376376
.replace("{type}", type.value)
@@ -404,7 +404,7 @@ class Account(client: Client) : Service(client) {
404404
*/
405405
@Throws(AppwriteException::class)
406406
suspend fun <T> updateMfaAuthenticator(
407-
type: AuthenticatorType,
407+
type: io.appwrite.enums.AuthenticatorType,
408408
otp: String,
409409
nestedType: Class<T>,
410410
): io.appwrite.models.User<T> {
@@ -441,7 +441,7 @@ class Account(client: Client) : Service(client) {
441441
*/
442442
@Throws(AppwriteException::class)
443443
suspend fun updateMfaAuthenticator(
444-
type: AuthenticatorType,
444+
type: io.appwrite.enums.AuthenticatorType,
445445
otp: String,
446446
): io.appwrite.models.User<Map<String, Any>> = updateMfaAuthenticator(
447447
type,
@@ -460,7 +460,7 @@ class Account(client: Client) : Service(client) {
460460
*/
461461
@Throws(AppwriteException::class)
462462
suspend fun <T> deleteMfaAuthenticator(
463-
type: AuthenticatorType,
463+
type: io.appwrite.enums.AuthenticatorType,
464464
otp: String,
465465
nestedType: Class<T>,
466466
): io.appwrite.models.User<T> {
@@ -497,7 +497,7 @@ class Account(client: Client) : Service(client) {
497497
*/
498498
@Throws(AppwriteException::class)
499499
suspend fun deleteMfaAuthenticator(
500-
type: AuthenticatorType,
500+
type: io.appwrite.enums.AuthenticatorType,
501501
otp: String,
502502
): io.appwrite.models.User<Map<String, Any>> = deleteMfaAuthenticator(
503503
type,
@@ -515,7 +515,7 @@ class Account(client: Client) : Service(client) {
515515
*/
516516
@Throws(AppwriteException::class)
517517
suspend fun createMfaChallenge(
518-
factor: AuthenticationFactor,
518+
factor: io.appwrite.enums.AuthenticationFactor,
519519
): io.appwrite.models.MfaChallenge {
520520
val apiPath = "/account/mfa/challenge"
521521

@@ -1489,7 +1489,7 @@ class Account(client: Client) : Service(client) {
14891489
@JvmOverloads
14901490
@Throws(AppwriteException::class)
14911491
suspend fun createOAuth2Token(
1492-
provider: OAuthProvider,
1492+
provider: io.appwrite.enums.OAuthProvider,
14931493
success: String? = null,
14941494
failure: String? = null,
14951495
scopes: List<String>? = null,

src/main/kotlin/io/appwrite/services/Avatars.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Avatars(client: Client) : Service(client) {
2929
@JvmOverloads
3030
@Throws(AppwriteException::class)
3131
suspend fun getBrowser(
32-
code: Browser,
32+
code: io.appwrite.enums.Browser,
3333
width: Long? = null,
3434
height: Long? = null,
3535
quality: Long? = null,
@@ -67,7 +67,7 @@ class Avatars(client: Client) : Service(client) {
6767
@JvmOverloads
6868
@Throws(AppwriteException::class)
6969
suspend fun getCreditCard(
70-
code: CreditCard,
70+
code: io.appwrite.enums.CreditCard,
7171
width: Long? = null,
7272
height: Long? = null,
7373
quality: Long? = null,
@@ -133,7 +133,7 @@ class Avatars(client: Client) : Service(client) {
133133
@JvmOverloads
134134
@Throws(AppwriteException::class)
135135
suspend fun getFlag(
136-
code: Flag,
136+
code: io.appwrite.enums.Flag,
137137
width: Long? = null,
138138
height: Long? = null,
139139
quality: Long? = null,

src/main/kotlin/io/appwrite/services/Databases.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,11 +1147,11 @@ class Databases(client: Client) : Service(client) {
11471147
databaseId: String,
11481148
collectionId: String,
11491149
relatedCollectionId: String,
1150-
type: RelationshipType,
1150+
type: io.appwrite.enums.RelationshipType,
11511151
twoWay: Boolean? = null,
11521152
key: String? = null,
11531153
twoWayKey: String? = null,
1154-
onDelete: RelationMutate? = null,
1154+
onDelete: io.appwrite.enums.RelationMutate? = null,
11551155
): io.appwrite.models.AttributeRelationship {
11561156
val apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship"
11571157
.replace("{databaseId}", databaseId)
@@ -1462,7 +1462,7 @@ class Databases(client: Client) : Service(client) {
14621462
databaseId: String,
14631463
collectionId: String,
14641464
key: String,
1465-
onDelete: RelationMutate? = null,
1465+
onDelete: io.appwrite.enums.RelationMutate? = null,
14661466
): io.appwrite.models.AttributeRelationship {
14671467
val apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship"
14681468
.replace("{databaseId}", databaseId)
@@ -1868,7 +1868,7 @@ class Databases(client: Client) : Service(client) {
18681868
databaseId: String,
18691869
collectionId: String,
18701870
key: String,
1871-
type: IndexType,
1871+
type: io.appwrite.enums.IndexType,
18721872
attributes: List<String>,
18731873
orders: List<String>? = null,
18741874
): io.appwrite.models.Index {

src/main/kotlin/io/appwrite/services/Functions.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Functions(client: Client) : Service(client) {
8484
suspend fun create(
8585
functionId: String,
8686
name: String,
87-
runtime: Runtime,
87+
runtime: io.appwrite.enums.Runtime,
8888
execute: List<String>? = null,
8989
events: List<String>? = null,
9090
schedule: String? = null,
@@ -234,7 +234,7 @@ class Functions(client: Client) : Service(client) {
234234
suspend fun update(
235235
functionId: String,
236236
name: String,
237-
runtime: Runtime? = null,
237+
runtime: io.appwrite.enums.Runtime? = null,
238238
execute: List<String>? = null,
239239
events: List<String>? = null,
240240
schedule: String? = null,
@@ -635,7 +635,7 @@ class Functions(client: Client) : Service(client) {
635635
body: String? = null,
636636
async: Boolean? = null,
637637
path: String? = null,
638-
method: ExecutionMethod? = null,
638+
method: io.appwrite.enums.ExecutionMethod? = null,
639639
headers: Any? = null,
640640
): io.appwrite.models.Execution {
641641
val apiPath = "/functions/{functionId}/executions"

src/main/kotlin/io/appwrite/services/Health.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class Health(client: Client) : Service(client) {
378378
@JvmOverloads
379379
@Throws(AppwriteException::class)
380380
suspend fun getFailedJobs(
381-
name: Name,
381+
name: io.appwrite.enums.Name,
382382
threshold: Long? = null,
383383
): io.appwrite.models.HealthQueue {
384384
val apiPath = "/health/queue/failed/{name}"

src/main/kotlin/io/appwrite/services/Messaging.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ class Messaging(client: Client) : Service(client) {
11721172
port: Long? = null,
11731173
username: String? = null,
11741174
password: String? = null,
1175-
encryption: SmtpEncryption? = null,
1175+
encryption: io.appwrite.enums.SmtpEncryption? = null,
11761176
autoTLS: Boolean? = null,
11771177
mailer: String? = null,
11781178
fromName: String? = null,
@@ -1245,7 +1245,7 @@ class Messaging(client: Client) : Service(client) {
12451245
port: Long? = null,
12461246
username: String? = null,
12471247
password: String? = null,
1248-
encryption: SmtpEncryption? = null,
1248+
encryption: io.appwrite.enums.SmtpEncryption? = null,
12491249
autoTLS: Boolean? = null,
12501250
mailer: String? = null,
12511251
fromName: String? = null,

src/main/kotlin/io/appwrite/services/Storage.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Storage(client: Client) : Service(client) {
7979
enabled: Boolean? = null,
8080
maximumFileSize: Long? = null,
8181
allowedFileExtensions: List<String>? = null,
82-
compression: Compression? = null,
82+
compression: io.appwrite.enums.Compression? = null,
8383
encryption: Boolean? = null,
8484
antivirus: Boolean? = null,
8585
): io.appwrite.models.Bucket {
@@ -173,7 +173,7 @@ class Storage(client: Client) : Service(client) {
173173
enabled: Boolean? = null,
174174
maximumFileSize: Long? = null,
175175
allowedFileExtensions: List<String>? = null,
176-
compression: Compression? = null,
176+
compression: io.appwrite.enums.Compression? = null,
177177
encryption: Boolean? = null,
178178
antivirus: Boolean? = null,
179179
): io.appwrite.models.Bucket {
@@ -493,15 +493,15 @@ class Storage(client: Client) : Service(client) {
493493
fileId: String,
494494
width: Long? = null,
495495
height: Long? = null,
496-
gravity: ImageGravity? = null,
496+
gravity: io.appwrite.enums.ImageGravity? = null,
497497
quality: Long? = null,
498498
borderWidth: Long? = null,
499499
borderColor: String? = null,
500500
borderRadius: Long? = null,
501501
opacity: Double? = null,
502502
rotation: Long? = null,
503503
background: String? = null,
504-
output: ImageFormat? = null,
504+
output: io.appwrite.enums.ImageFormat? = null,
505505
): ByteArray {
506506
val apiPath = "/storage/buckets/{bucketId}/files/{fileId}/preview"
507507
.replace("{bucketId}", bucketId)

src/main/kotlin/io/appwrite/services/Users.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ class Users(client: Client) : Service(client) {
699699
userId: String,
700700
email: String,
701701
password: String,
702-
passwordVersion: PasswordHash? = null,
702+
passwordVersion: io.appwrite.enums.PasswordHash? = null,
703703
name: String? = null,
704704
nestedType: Class<T>,
705705
): io.appwrite.models.User<T> {
@@ -746,7 +746,7 @@ class Users(client: Client) : Service(client) {
746746
userId: String,
747747
email: String,
748748
password: String,
749-
passwordVersion: PasswordHash? = null,
749+
passwordVersion: io.appwrite.enums.PasswordHash? = null,
750750
name: String? = null,
751751
): io.appwrite.models.User<Map<String, Any>> = createSHAUser(
752752
userId,
@@ -1086,7 +1086,7 @@ class Users(client: Client) : Service(client) {
10861086
@Throws(AppwriteException::class)
10871087
suspend fun <T> deleteMfaAuthenticator(
10881088
userId: String,
1089-
type: AuthenticatorType,
1089+
type: io.appwrite.enums.AuthenticatorType,
10901090
nestedType: Class<T>,
10911091
): io.appwrite.models.User<T> {
10921092
val apiPath = "/users/{userId}/mfa/authenticators/{type}"
@@ -1123,7 +1123,7 @@ class Users(client: Client) : Service(client) {
11231123
@Throws(AppwriteException::class)
11241124
suspend fun deleteMfaAuthenticator(
11251125
userId: String,
1126-
type: AuthenticatorType,
1126+
type: io.appwrite.enums.AuthenticatorType,
11271127
): io.appwrite.models.User<Map<String, Any>> = deleteMfaAuthenticator(
11281128
userId,
11291129
type,
@@ -1774,7 +1774,7 @@ class Users(client: Client) : Service(client) {
17741774
suspend fun createTarget(
17751775
userId: String,
17761776
targetId: String,
1777-
providerType: MessagingProviderType,
1777+
providerType: io.appwrite.enums.MessagingProviderType,
17781778
identifier: String,
17791779
providerId: String? = null,
17801780
name: String? = null,

0 commit comments

Comments
 (0)