Skip to content

Commit 04571fb

Browse files
committed
regen
1 parent 6655960 commit 04571fb

34 files changed

+172
-166
lines changed

Sources/Appwrite/Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ open class Client {
415415

416416
if let warning = response.headers["x-appwrite-warning"].first {
417417
warning.split(separator: ";").forEach { warning in
418-
print("Warning: \(warning)")
418+
fputs("Warning: \(warning)\n", stderr)
419419
}
420420
}
421421

Sources/Appwrite/Query.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ public struct Query : Codable, CustomStringConvertible {
280280
).description
281281
}
282282

283+
public static func orderRandom() -> String {
284+
return Query(
285+
method: "orderRandom"
286+
).description
287+
}
288+
283289
public static func cursorBefore(_ id: String) -> String {
284290
return Query(
285291
method: "cursorBefore",

Sources/Appwrite/Services/Account.swift

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,13 @@ open class Account: Service {
387387
/// method.
388388
///
389389
/// - Parameters:
390-
/// - type: AuthenticatorType
390+
/// - type: AppwriteEnums.AuthenticatorType
391391
/// - Throws: Exception if the request fails
392392
/// - Returns: AppwriteModels.MfaType
393393
///
394394
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `Account.createMFAAuthenticator` instead.")
395395
open func createMfaAuthenticator(
396-
type: AuthenticatorType
396+
type: AppwriteEnums.AuthenticatorType
397397
) async throws -> AppwriteModels.MfaType {
398398
let apiPath: String = "/account/mfa/authenticators/{type}"
399399
.replacingOccurrences(of: "{type}", with: type.rawValue)
@@ -424,12 +424,12 @@ open class Account: Service {
424424
/// method.
425425
///
426426
/// - Parameters:
427-
/// - type: AuthenticatorType
427+
/// - type: AppwriteEnums.AuthenticatorType
428428
/// - Throws: Exception if the request fails
429429
/// - Returns: AppwriteModels.MfaType
430430
///
431431
open func createMFAAuthenticator(
432-
type: AuthenticatorType
432+
type: AppwriteEnums.AuthenticatorType
433433
) async throws -> AppwriteModels.MfaType {
434434
let apiPath: String = "/account/mfa/authenticators/{type}"
435435
.replacingOccurrences(of: "{type}", with: type.rawValue)
@@ -459,14 +459,14 @@ open class Account: Service {
459459
/// method.
460460
///
461461
/// - Parameters:
462-
/// - type: AuthenticatorType
462+
/// - type: AppwriteEnums.AuthenticatorType
463463
/// - otp: String
464464
/// - Throws: Exception if the request fails
465465
/// - Returns: AppwriteModels.User<T>
466466
///
467467
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `Account.updateMFAAuthenticator` instead.")
468468
open func updateMfaAuthenticator<T>(
469-
type: AuthenticatorType,
469+
type: AppwriteEnums.AuthenticatorType,
470470
otp: String,
471471
nestedType: T.Type
472472
) async throws -> AppwriteModels.User<T> {
@@ -500,14 +500,14 @@ open class Account: Service {
500500
/// method.
501501
///
502502
/// - Parameters:
503-
/// - type: AuthenticatorType
503+
/// - type: AppwriteEnums.AuthenticatorType
504504
/// - otp: String
505505
/// - Throws: Exception if the request fails
506506
/// - Returns: AppwriteModels.User<T>
507507
///
508508
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `Account.updateMFAAuthenticator` instead.")
509509
open func updateMfaAuthenticator(
510-
type: AuthenticatorType,
510+
type: AppwriteEnums.AuthenticatorType,
511511
otp: String
512512
) async throws -> AppwriteModels.User<[String: AnyCodable]> {
513513
return try await updateMfaAuthenticator(
@@ -523,13 +523,13 @@ open class Account: Service {
523523
/// method.
524524
///
525525
/// - Parameters:
526-
/// - type: AuthenticatorType
526+
/// - type: AppwriteEnums.AuthenticatorType
527527
/// - otp: String
528528
/// - Throws: Exception if the request fails
529529
/// - Returns: AppwriteModels.User<T>
530530
///
531531
open func updateMFAAuthenticator<T>(
532-
type: AuthenticatorType,
532+
type: AppwriteEnums.AuthenticatorType,
533533
otp: String,
534534
nestedType: T.Type
535535
) async throws -> AppwriteModels.User<T> {
@@ -563,13 +563,13 @@ open class Account: Service {
563563
/// method.
564564
///
565565
/// - Parameters:
566-
/// - type: AuthenticatorType
566+
/// - type: AppwriteEnums.AuthenticatorType
567567
/// - otp: String
568568
/// - Throws: Exception if the request fails
569569
/// - Returns: AppwriteModels.User<T>
570570
///
571571
open func updateMFAAuthenticator(
572-
type: AuthenticatorType,
572+
type: AppwriteEnums.AuthenticatorType,
573573
otp: String
574574
) async throws -> AppwriteModels.User<[String: AnyCodable]> {
575575
return try await updateMFAAuthenticator(
@@ -583,13 +583,13 @@ open class Account: Service {
583583
/// Delete an authenticator for a user by ID.
584584
///
585585
/// - Parameters:
586-
/// - type: AuthenticatorType
586+
/// - type: AppwriteEnums.AuthenticatorType
587587
/// - Throws: Exception if the request fails
588588
/// - Returns: Any
589589
///
590590
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `Account.deleteMFAAuthenticator` instead.")
591591
open func deleteMfaAuthenticator(
592-
type: AuthenticatorType
592+
type: AppwriteEnums.AuthenticatorType
593593
) async throws -> Any {
594594
let apiPath: String = "/account/mfa/authenticators/{type}"
595595
.replacingOccurrences(of: "{type}", with: type.rawValue)
@@ -611,12 +611,12 @@ open class Account: Service {
611611
/// Delete an authenticator for a user by ID.
612612
///
613613
/// - Parameters:
614-
/// - type: AuthenticatorType
614+
/// - type: AppwriteEnums.AuthenticatorType
615615
/// - Throws: Exception if the request fails
616616
/// - Returns: Any
617617
///
618618
open func deleteMFAAuthenticator(
619-
type: AuthenticatorType
619+
type: AppwriteEnums.AuthenticatorType
620620
) async throws -> Any {
621621
let apiPath: String = "/account/mfa/authenticators/{type}"
622622
.replacingOccurrences(of: "{type}", with: type.rawValue)
@@ -640,13 +640,13 @@ open class Account: Service {
640640
/// method.
641641
///
642642
/// - Parameters:
643-
/// - factor: AuthenticationFactor
643+
/// - factor: AppwriteEnums.AuthenticationFactor
644644
/// - Throws: Exception if the request fails
645645
/// - Returns: AppwriteModels.MfaChallenge
646646
///
647647
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead.")
648648
open func createMfaChallenge(
649-
factor: AuthenticationFactor
649+
factor: AppwriteEnums.AuthenticationFactor
650650
) async throws -> AppwriteModels.MfaChallenge {
651651
let apiPath: String = "/account/mfa/challenge"
652652

@@ -677,12 +677,12 @@ open class Account: Service {
677677
/// method.
678678
///
679679
/// - Parameters:
680-
/// - factor: AuthenticationFactor
680+
/// - factor: AppwriteEnums.AuthenticationFactor
681681
/// - Throws: Exception if the request fails
682682
/// - Returns: AppwriteModels.MfaChallenge
683683
///
684684
open func createMFAChallenge(
685-
factor: AuthenticationFactor
685+
factor: AppwriteEnums.AuthenticationFactor
686686
) async throws -> AppwriteModels.MfaChallenge {
687687
let apiPath: String = "/account/mfa/challenge"
688688

@@ -1927,15 +1927,15 @@ open class Account: Service {
19271927
/// limits](https://appwrite.io/docs/authentication-security#limits).
19281928
///
19291929
/// - Parameters:
1930-
/// - provider: OAuthProvider
1930+
/// - provider: AppwriteEnums.OAuthProvider
19311931
/// - success: String (optional)
19321932
/// - failure: String (optional)
19331933
/// - scopes: [String] (optional)
19341934
/// - Throws: Exception if the request fails
19351935
/// - Returns: String?
19361936
///
19371937
open func createOAuth2Token(
1938-
provider: OAuthProvider,
1938+
provider: AppwriteEnums.OAuthProvider,
19391939
success: String? = nil,
19401940
failure: String? = nil,
19411941
scopes: [String]? = nil

Sources/Appwrite/Services/Avatars.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ open class Avatars: Service {
2121
/// of image returned is 100x100px.
2222
///
2323
/// - Parameters:
24-
/// - code: Browser
24+
/// - code: AppwriteEnums.Browser
2525
/// - width: Int (optional)
2626
/// - height: Int (optional)
2727
/// - quality: Int (optional)
2828
/// - Throws: Exception if the request fails
2929
/// - Returns: ByteBuffer
3030
///
3131
open func getBrowser(
32-
code: Browser,
32+
code: AppwriteEnums.Browser,
3333
width: Int? = nil,
3434
height: Int? = nil,
3535
quality: Int? = nil
@@ -66,15 +66,15 @@ open class Avatars: Service {
6666
///
6767
///
6868
/// - Parameters:
69-
/// - code: CreditCard
69+
/// - code: AppwriteEnums.CreditCard
7070
/// - width: Int (optional)
7171
/// - height: Int (optional)
7272
/// - quality: Int (optional)
7373
/// - Throws: Exception if the request fails
7474
/// - Returns: ByteBuffer
7575
///
7676
open func getCreditCard(
77-
code: CreditCard,
77+
code: AppwriteEnums.CreditCard,
7878
width: Int? = nil,
7979
height: Int? = nil,
8080
quality: Int? = nil
@@ -143,15 +143,15 @@ open class Avatars: Service {
143143
///
144144
///
145145
/// - Parameters:
146-
/// - code: Flag
146+
/// - code: AppwriteEnums.Flag
147147
/// - width: Int (optional)
148148
/// - height: Int (optional)
149149
/// - quality: Int (optional)
150150
/// - Throws: Exception if the request fails
151151
/// - Returns: ByteBuffer
152152
///
153153
open func getFlag(
154-
code: Flag,
154+
code: AppwriteEnums.Flag,
155155
width: Int? = nil,
156156
height: Int? = nil,
157157
quality: Int? = nil

Sources/Appwrite/Services/Databases.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,11 +1494,11 @@ open class Databases: Service {
14941494
/// - databaseId: String
14951495
/// - collectionId: String
14961496
/// - relatedCollectionId: String
1497-
/// - type: RelationshipType
1497+
/// - type: AppwriteEnums.RelationshipType
14981498
/// - twoWay: Bool (optional)
14991499
/// - key: String (optional)
15001500
/// - twoWayKey: String (optional)
1501-
/// - onDelete: RelationMutate (optional)
1501+
/// - onDelete: AppwriteEnums.RelationMutate (optional)
15021502
/// - Throws: Exception if the request fails
15031503
/// - Returns: AppwriteModels.AttributeRelationship
15041504
///
@@ -1507,11 +1507,11 @@ open class Databases: Service {
15071507
databaseId: String,
15081508
collectionId: String,
15091509
relatedCollectionId: String,
1510-
type: RelationshipType,
1510+
type: AppwriteEnums.RelationshipType,
15111511
twoWay: Bool? = nil,
15121512
key: String? = nil,
15131513
twoWayKey: String? = nil,
1514-
onDelete: RelationMutate? = nil
1514+
onDelete: AppwriteEnums.RelationMutate? = nil
15151515
) async throws -> AppwriteModels.AttributeRelationship {
15161516
let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship"
15171517
.replacingOccurrences(of: "{databaseId}", with: databaseId)
@@ -1833,7 +1833,7 @@ open class Databases: Service {
18331833
/// - databaseId: String
18341834
/// - collectionId: String
18351835
/// - key: String
1836-
/// - onDelete: RelationMutate (optional)
1836+
/// - onDelete: AppwriteEnums.RelationMutate (optional)
18371837
/// - newKey: String (optional)
18381838
/// - Throws: Exception if the request fails
18391839
/// - Returns: AppwriteModels.AttributeRelationship
@@ -1843,7 +1843,7 @@ open class Databases: Service {
18431843
databaseId: String,
18441844
collectionId: String,
18451845
key: String,
1846-
onDelete: RelationMutate? = nil,
1846+
onDelete: AppwriteEnums.RelationMutate? = nil,
18471847
newKey: String? = nil
18481848
) async throws -> AppwriteModels.AttributeRelationship {
18491849
let apiPath: String = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship"
@@ -2799,7 +2799,7 @@ open class Databases: Service {
27992799
/// - databaseId: String
28002800
/// - collectionId: String
28012801
/// - key: String
2802-
/// - type: IndexType
2802+
/// - type: AppwriteEnums.IndexType
28032803
/// - attributes: [String]
28042804
/// - orders: [String] (optional)
28052805
/// - lengths: [Int] (optional)
@@ -2811,7 +2811,7 @@ open class Databases: Service {
28112811
databaseId: String,
28122812
collectionId: String,
28132813
key: String,
2814-
type: IndexType,
2814+
type: AppwriteEnums.IndexType,
28152815
attributes: [String],
28162816
orders: [String]? = nil,
28172817
lengths: [Int]? = nil

0 commit comments

Comments
 (0)