Skip to content

Commit 35af039

Browse files
committed
Add order random
1 parent 8ea3ded commit 35af039

19 files changed

+33
-27
lines changed

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: "git@github.com:appwrite/sdk-for-swift.git", from: "12.0.0"),
36+
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "12.1.0"),
3737
],
3838
```
3939

Sources/Appwrite/Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ open class Client {
2121
"x-sdk-name": "Swift",
2222
"x-sdk-platform": "server",
2323
"x-sdk-language": "swift",
24-
"x-sdk-version": "12.0.0",
24+
"x-sdk-version": "12.1.0",
2525
"x-appwrite-response-format": "1.8.0"
2626
]
2727

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/AppwriteModels/Deployment.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ open class Deployment: Codable {
2525
case providerRepositoryName = "providerRepositoryName"
2626
case providerRepositoryOwner = "providerRepositoryOwner"
2727
case providerRepositoryUrl = "providerRepositoryUrl"
28-
case providerBranch = "providerBranch"
2928
case providerCommitHash = "providerCommitHash"
3029
case providerCommitAuthorUrl = "providerCommitAuthorUrl"
3130
case providerCommitAuthor = "providerCommitAuthor"
3231
case providerCommitMessage = "providerCommitMessage"
3332
case providerCommitUrl = "providerCommitUrl"
33+
case providerBranch = "providerBranch"
3434
case providerBranchUrl = "providerBranchUrl"
3535
}
3636

@@ -94,9 +94,6 @@ open class Deployment: Codable {
9494
/// The url of the vcs provider repository
9595
public let providerRepositoryUrl: String
9696

97-
/// The branch of the vcs repository
98-
public let providerBranch: String
99-
10097
/// The commit hash of the vcs commit
10198
public let providerCommitHash: String
10299

@@ -112,6 +109,9 @@ open class Deployment: Codable {
112109
/// The url of the vcs commit
113110
public let providerCommitUrl: String
114111

112+
/// The branch of the vcs repository
113+
public let providerBranch: String
114+
115115
/// The branch of the vcs repository
116116
public let providerBranchUrl: String
117117

@@ -137,12 +137,12 @@ open class Deployment: Codable {
137137
providerRepositoryName: String,
138138
providerRepositoryOwner: String,
139139
providerRepositoryUrl: String,
140-
providerBranch: String,
141140
providerCommitHash: String,
142141
providerCommitAuthorUrl: String,
143142
providerCommitAuthor: String,
144143
providerCommitMessage: String,
145144
providerCommitUrl: String,
145+
providerBranch: String,
146146
providerBranchUrl: String
147147
) {
148148
self.id = id
@@ -165,12 +165,12 @@ open class Deployment: Codable {
165165
self.providerRepositoryName = providerRepositoryName
166166
self.providerRepositoryOwner = providerRepositoryOwner
167167
self.providerRepositoryUrl = providerRepositoryUrl
168-
self.providerBranch = providerBranch
169168
self.providerCommitHash = providerCommitHash
170169
self.providerCommitAuthorUrl = providerCommitAuthorUrl
171170
self.providerCommitAuthor = providerCommitAuthor
172171
self.providerCommitMessage = providerCommitMessage
173172
self.providerCommitUrl = providerCommitUrl
173+
self.providerBranch = providerBranch
174174
self.providerBranchUrl = providerBranchUrl
175175
}
176176

@@ -197,12 +197,12 @@ open class Deployment: Codable {
197197
self.providerRepositoryName = try container.decode(String.self, forKey: .providerRepositoryName)
198198
self.providerRepositoryOwner = try container.decode(String.self, forKey: .providerRepositoryOwner)
199199
self.providerRepositoryUrl = try container.decode(String.self, forKey: .providerRepositoryUrl)
200-
self.providerBranch = try container.decode(String.self, forKey: .providerBranch)
201200
self.providerCommitHash = try container.decode(String.self, forKey: .providerCommitHash)
202201
self.providerCommitAuthorUrl = try container.decode(String.self, forKey: .providerCommitAuthorUrl)
203202
self.providerCommitAuthor = try container.decode(String.self, forKey: .providerCommitAuthor)
204203
self.providerCommitMessage = try container.decode(String.self, forKey: .providerCommitMessage)
205204
self.providerCommitUrl = try container.decode(String.self, forKey: .providerCommitUrl)
205+
self.providerBranch = try container.decode(String.self, forKey: .providerBranch)
206206
self.providerBranchUrl = try container.decode(String.self, forKey: .providerBranchUrl)
207207
}
208208

@@ -229,12 +229,12 @@ open class Deployment: Codable {
229229
try container.encode(providerRepositoryName, forKey: .providerRepositoryName)
230230
try container.encode(providerRepositoryOwner, forKey: .providerRepositoryOwner)
231231
try container.encode(providerRepositoryUrl, forKey: .providerRepositoryUrl)
232-
try container.encode(providerBranch, forKey: .providerBranch)
233232
try container.encode(providerCommitHash, forKey: .providerCommitHash)
234233
try container.encode(providerCommitAuthorUrl, forKey: .providerCommitAuthorUrl)
235234
try container.encode(providerCommitAuthor, forKey: .providerCommitAuthor)
236235
try container.encode(providerCommitMessage, forKey: .providerCommitMessage)
237236
try container.encode(providerCommitUrl, forKey: .providerCommitUrl)
237+
try container.encode(providerBranch, forKey: .providerBranch)
238238
try container.encode(providerBranchUrl, forKey: .providerBranchUrl)
239239
}
240240

@@ -260,12 +260,12 @@ open class Deployment: Codable {
260260
"providerRepositoryName": providerRepositoryName as Any,
261261
"providerRepositoryOwner": providerRepositoryOwner as Any,
262262
"providerRepositoryUrl": providerRepositoryUrl as Any,
263-
"providerBranch": providerBranch as Any,
264263
"providerCommitHash": providerCommitHash as Any,
265264
"providerCommitAuthorUrl": providerCommitAuthorUrl as Any,
266265
"providerCommitAuthor": providerCommitAuthor as Any,
267266
"providerCommitMessage": providerCommitMessage as Any,
268267
"providerCommitUrl": providerCommitUrl as Any,
268+
"providerBranch": providerBranch as Any,
269269
"providerBranchUrl": providerBranchUrl as Any
270270
]
271271
}
@@ -292,12 +292,12 @@ open class Deployment: Codable {
292292
providerRepositoryName: map["providerRepositoryName"] as! String,
293293
providerRepositoryOwner: map["providerRepositoryOwner"] as! String,
294294
providerRepositoryUrl: map["providerRepositoryUrl"] as! String,
295-
providerBranch: map["providerBranch"] as! String,
296295
providerCommitHash: map["providerCommitHash"] as! String,
297296
providerCommitAuthorUrl: map["providerCommitAuthorUrl"] as! String,
298297
providerCommitAuthor: map["providerCommitAuthor"] as! String,
299298
providerCommitMessage: map["providerCommitMessage"] as! String,
300299
providerCommitUrl: map["providerCommitUrl"] as! String,
300+
providerBranch: map["providerBranch"] as! String,
301301
providerBranchUrl: map["providerBranchUrl"] as! String
302302
)
303303
}

Sources/AppwriteModels/Execution.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ open class Execution: Codable {
5555
/// HTTP request path and query.
5656
public let requestPath: String
5757

58-
/// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
58+
/// HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
5959
public let requestHeaders: [Headers]
6060

6161
/// HTTP response status code.

Sources/AppwriteModels/HealthAntivirus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ open class HealthAntivirus: Codable {
1212
/// Antivirus version.
1313
public let version: String
1414

15-
/// Antivirus status. Possible values can are: `disabled`, `offline`, `online`
15+
/// Antivirus status. Possible values are: `disabled`, `offline`, `online`
1616
public let status: String
1717

1818

Sources/AppwriteModels/HealthStatus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ open class HealthStatus: Codable {
1616
/// Duration in milliseconds how long the health check took.
1717
public let ping: Int
1818

19-
/// Service status. Possible values can are: `pass`, `fail`
19+
/// Service status. Possible values are: `pass`, `fail`
2020
public let status: String
2121

2222

docs/examples/databases/create-line-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ let attributeLine = try await databases.createLineAttribute(
1212
collectionId: "<COLLECTION_ID>",
1313
key: "",
1414
required: false,
15-
default: [[1,2], [3, 4]] // optional
15+
default: [[1, 2], [3, 4], [5, 6]] // optional
1616
)
1717

docs/examples/databases/create-point-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ let attributePoint = try await databases.createPointAttribute(
1212
collectionId: "<COLLECTION_ID>",
1313
key: "",
1414
required: false,
15-
default: [[1,2], [3, 4]] // optional
15+
default: [1, 2] // optional
1616
)
1717

docs/examples/databases/create-polygon-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ let attributePolygon = try await databases.createPolygonAttribute(
1212
collectionId: "<COLLECTION_ID>",
1313
key: "",
1414
required: false,
15-
default: [[1,2], [3, 4]] // optional
15+
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional
1616
)
1717

0 commit comments

Comments
 (0)