Skip to content

Commit 9277606

Browse files
Merge pull request #6 from appwrite/dev
Fix nested models
2 parents e7e2a2e + 69041a7 commit 9277606

File tree

6 files changed

+62
-62
lines changed

6 files changed

+62
-62
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:
3333

3434
```swift
3535
dependencies: [
36-
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "1.2.0"),
36+
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "1.2.1"),
3737
],
3838
```
3939

Sources/Appwrite/Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open class Client {
2323
"x-sdk-name": "Swift",
2424
"x-sdk-platform": "server",
2525
"x-sdk-language": "swift",
26-
"x-sdk-version": "1.2.0",
26+
"x-sdk-version": "1.2.1",
2727
"X-Appwrite-Response-Format": "1.0.0"
2828
]
2929

Sources/Appwrite/Services/Account.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ open class Account: Service {
1515
/// @return array
1616
///
1717
open func get<T>(
18-
nestedType: T.Type,
18+
nestedType: T.Type
1919
) async throws -> AppwriteModels.Account<T> {
2020
let path: String = "/account"
2121

@@ -72,8 +72,8 @@ open class Account: Service {
7272
///
7373
open func updateEmail<T>(
7474
email: String,
75-
password: String
76-
nestedType: T.Type,
75+
password: String,
76+
nestedType: T.Type
7777
) async throws -> AppwriteModels.Account<T> {
7878
let path: String = "/account/email"
7979

@@ -173,8 +173,8 @@ open class Account: Service {
173173
/// @return array
174174
///
175175
open func updateName<T>(
176-
name: String
177-
nestedType: T.Type,
176+
name: String,
177+
nestedType: T.Type
178178
) async throws -> AppwriteModels.Account<T> {
179179
let path: String = "/account/name"
180180

@@ -231,8 +231,8 @@ open class Account: Service {
231231
///
232232
open func updatePassword<T>(
233233
password: String,
234-
oldPassword: String? = nil
235-
nestedType: T.Type,
234+
oldPassword: String? = nil,
235+
nestedType: T.Type
236236
) async throws -> AppwriteModels.Account<T> {
237237
let path: String = "/account/password"
238238

@@ -297,8 +297,8 @@ open class Account: Service {
297297
///
298298
open func updatePhone<T>(
299299
phone: String,
300-
password: String
301-
nestedType: T.Type,
300+
password: String,
301+
nestedType: T.Type
302302
) async throws -> AppwriteModels.Account<T> {
303303
let path: String = "/account/phone"
304304

@@ -358,7 +358,7 @@ open class Account: Service {
358358
/// @return array
359359
///
360360
open func getPrefs<T>(
361-
nestedType: T.Type,
361+
nestedType: T.Type
362362
) async throws -> AppwriteModels.Preferences<T> {
363363
let path: String = "/account/prefs"
364364

@@ -408,8 +408,8 @@ open class Account: Service {
408408
/// @return array
409409
///
410410
open func updatePrefs<T>(
411-
prefs: T
412-
nestedType: T.Type,
411+
prefs: T,
412+
nestedType: T.Type
413413
) async throws -> AppwriteModels.Account<T> {
414414
let path: String = "/account/prefs"
415415

@@ -722,7 +722,7 @@ open class Account: Service {
722722
/// @return array
723723
///
724724
open func updateStatus<T>(
725-
nestedType: T.Type,
725+
nestedType: T.Type
726726
) async throws -> AppwriteModels.Account<T> {
727727
let path: String = "/account/status"
728728

Sources/Appwrite/Services/Databases.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -985,8 +985,8 @@ open class Databases: Service {
985985
open func listDocuments<T>(
986986
databaseId: String,
987987
collectionId: String,
988-
queries: [String]? = nil
989-
nestedType: T.Type,
988+
queries: [String]? = nil,
989+
nestedType: T.Type
990990
) async throws -> AppwriteModels.DocumentList<T> {
991991
let path: String = "/databases/{databaseId}/collections/{collectionId}/documents"
992992
.replacingOccurrences(of: "{databaseId}", with: databaseId)
@@ -1059,8 +1059,8 @@ open class Databases: Service {
10591059
collectionId: String,
10601060
documentId: String,
10611061
data: T,
1062-
permissions: [String]? = nil
1063-
nestedType: T.Type,
1062+
permissions: [String]? = nil,
1063+
nestedType: T.Type
10641064
) async throws -> AppwriteModels.Document<T> {
10651065
let path: String = "/databases/{databaseId}/collections/{collectionId}/documents"
10661066
.replacingOccurrences(of: "{databaseId}", with: databaseId)
@@ -1137,8 +1137,8 @@ open class Databases: Service {
11371137
open func getDocument<T>(
11381138
databaseId: String,
11391139
collectionId: String,
1140-
documentId: String
1141-
nestedType: T.Type,
1140+
documentId: String,
1141+
nestedType: T.Type
11421142
) async throws -> AppwriteModels.Document<T> {
11431143
let path: String = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}"
11441144
.replacingOccurrences(of: "{databaseId}", with: databaseId)
@@ -1208,8 +1208,8 @@ open class Databases: Service {
12081208
collectionId: String,
12091209
documentId: String,
12101210
data: T? = nil,
1211-
permissions: [String]? = nil
1212-
nestedType: T.Type,
1211+
permissions: [String]? = nil,
1212+
nestedType: T.Type
12131213
) async throws -> AppwriteModels.Document<T> {
12141214
let path: String = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}"
12151215
.replacingOccurrences(of: "{databaseId}", with: databaseId)

Sources/Appwrite/Services/Users.swift

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ open class Users: Service {
1919
///
2020
open func list<T>(
2121
queries: [String]? = nil,
22-
search: String? = nil
23-
nestedType: T.Type,
22+
search: String? = nil,
23+
nestedType: T.Type
2424
) async throws -> AppwriteModels.UserList<T> {
2525
let path: String = "/users"
2626

@@ -86,8 +86,8 @@ open class Users: Service {
8686
email: String? = nil,
8787
phone: String? = nil,
8888
password: String? = nil,
89-
name: String? = nil
90-
nestedType: T.Type,
89+
name: String? = nil,
90+
nestedType: T.Type
9191
) async throws -> AppwriteModels.User<T> {
9292
let path: String = "/users"
9393

@@ -165,8 +165,8 @@ open class Users: Service {
165165
userId: String,
166166
email: String,
167167
password: String,
168-
name: String? = nil
169-
nestedType: T.Type,
168+
name: String? = nil,
169+
nestedType: T.Type
170170
) async throws -> AppwriteModels.User<T> {
171171
let path: String = "/users/argon2"
172172

@@ -243,8 +243,8 @@ open class Users: Service {
243243
userId: String,
244244
email: String,
245245
password: String,
246-
name: String? = nil
247-
nestedType: T.Type,
246+
name: String? = nil,
247+
nestedType: T.Type
248248
) async throws -> AppwriteModels.User<T> {
249249
let path: String = "/users/bcrypt"
250250

@@ -321,8 +321,8 @@ open class Users: Service {
321321
userId: String,
322322
email: String,
323323
password: String,
324-
name: String? = nil
325-
nestedType: T.Type,
324+
name: String? = nil,
325+
nestedType: T.Type
326326
) async throws -> AppwriteModels.User<T> {
327327
let path: String = "/users/md5"
328328

@@ -399,8 +399,8 @@ open class Users: Service {
399399
userId: String,
400400
email: String,
401401
password: String,
402-
name: String? = nil
403-
nestedType: T.Type,
402+
name: String? = nil,
403+
nestedType: T.Type
404404
) async throws -> AppwriteModels.User<T> {
405405
let path: String = "/users/phpass"
406406

@@ -487,8 +487,8 @@ open class Users: Service {
487487
passwordMemory: Int,
488488
passwordParallel: Int,
489489
passwordLength: Int,
490-
name: String? = nil
491-
nestedType: T.Type,
490+
name: String? = nil,
491+
nestedType: T.Type
492492
) async throws -> AppwriteModels.User<T> {
493493
let path: String = "/users/scrypt"
494494

@@ -591,8 +591,8 @@ open class Users: Service {
591591
passwordSalt: String,
592592
passwordSaltSeparator: String,
593593
passwordSignerKey: String,
594-
name: String? = nil
595-
nestedType: T.Type,
594+
name: String? = nil,
595+
nestedType: T.Type
596596
) async throws -> AppwriteModels.User<T> {
597597
let path: String = "/users/scrypt-modified"
598598

@@ -683,8 +683,8 @@ open class Users: Service {
683683
email: String,
684684
password: String,
685685
passwordVersion: String? = nil,
686-
name: String? = nil
687-
nestedType: T.Type,
686+
name: String? = nil,
687+
nestedType: T.Type
688688
) async throws -> AppwriteModels.User<T> {
689689
let path: String = "/users/sha"
690690

@@ -756,8 +756,8 @@ open class Users: Service {
756756
/// @return array
757757
///
758758
open func get<T>(
759-
userId: String
760-
nestedType: T.Type,
759+
userId: String,
760+
nestedType: T.Type
761761
) async throws -> AppwriteModels.User<T> {
762762
let path: String = "/users/{userId}"
763763
.replacingOccurrences(of: "{userId}", with: userId)
@@ -843,8 +843,8 @@ open class Users: Service {
843843
///
844844
open func updateEmail<T>(
845845
userId: String,
846-
email: String
847-
nestedType: T.Type,
846+
email: String,
847+
nestedType: T.Type
848848
) async throws -> AppwriteModels.User<T> {
849849
let path: String = "/users/{userId}/email"
850850
.replacingOccurrences(of: "{userId}", with: userId)
@@ -975,8 +975,8 @@ open class Users: Service {
975975
///
976976
open func updateName<T>(
977977
userId: String,
978-
name: String
979-
nestedType: T.Type,
978+
name: String,
979+
nestedType: T.Type
980980
) async throws -> AppwriteModels.User<T> {
981981
let path: String = "/users/{userId}/name"
982982
.replacingOccurrences(of: "{userId}", with: userId)
@@ -1035,8 +1035,8 @@ open class Users: Service {
10351035
///
10361036
open func updatePassword<T>(
10371037
userId: String,
1038-
password: String
1039-
nestedType: T.Type,
1038+
password: String,
1039+
nestedType: T.Type
10401040
) async throws -> AppwriteModels.User<T> {
10411041
let path: String = "/users/{userId}/password"
10421042
.replacingOccurrences(of: "{userId}", with: userId)
@@ -1095,8 +1095,8 @@ open class Users: Service {
10951095
///
10961096
open func updatePhone<T>(
10971097
userId: String,
1098-
number: String
1099-
nestedType: T.Type,
1098+
number: String,
1099+
nestedType: T.Type
11001100
) async throws -> AppwriteModels.User<T> {
11011101
let path: String = "/users/{userId}/phone"
11021102
.replacingOccurrences(of: "{userId}", with: userId)
@@ -1153,8 +1153,8 @@ open class Users: Service {
11531153
/// @return array
11541154
///
11551155
open func getPrefs<T>(
1156-
userId: String
1157-
nestedType: T.Type,
1156+
userId: String,
1157+
nestedType: T.Type
11581158
) async throws -> AppwriteModels.Preferences<T> {
11591159
let path: String = "/users/{userId}/prefs"
11601160
.replacingOccurrences(of: "{userId}", with: userId)
@@ -1210,8 +1210,8 @@ open class Users: Service {
12101210
///
12111211
open func updatePrefs<T>(
12121212
userId: String,
1213-
prefs: T
1214-
nestedType: T.Type,
1213+
prefs: T,
1214+
nestedType: T.Type
12151215
) async throws -> AppwriteModels.Preferences<T> {
12161216
let path: String = "/users/{userId}/prefs"
12171217
.replacingOccurrences(of: "{userId}", with: userId)
@@ -1366,8 +1366,8 @@ open class Users: Service {
13661366
///
13671367
open func updateStatus<T>(
13681368
userId: String,
1369-
status: Bool
1370-
nestedType: T.Type,
1369+
status: Bool,
1370+
nestedType: T.Type
13711371
) async throws -> AppwriteModels.User<T> {
13721372
let path: String = "/users/{userId}/status"
13731373
.replacingOccurrences(of: "{userId}", with: userId)
@@ -1427,8 +1427,8 @@ open class Users: Service {
14271427
///
14281428
open func updateEmailVerification<T>(
14291429
userId: String,
1430-
emailVerification: Bool
1431-
nestedType: T.Type,
1430+
emailVerification: Bool,
1431+
nestedType: T.Type
14321432
) async throws -> AppwriteModels.User<T> {
14331433
let path: String = "/users/{userId}/verification"
14341434
.replacingOccurrences(of: "{userId}", with: userId)
@@ -1487,8 +1487,8 @@ open class Users: Service {
14871487
///
14881488
open func updatePhoneVerification<T>(
14891489
userId: String,
1490-
phoneVerification: Bool
1491-
nestedType: T.Type,
1490+
phoneVerification: Bool,
1491+
nestedType: T.Type
14921492
) async throws -> AppwriteModels.User<T> {
14931493
let path: String = "/users/{userId}/verification/phone"
14941494
.replacingOccurrences(of: "{userId}", with: userId)

0 commit comments

Comments
 (0)