Skip to content

Commit 6a887e3

Browse files
committed
ParseInstallation & ParseUser
1 parent 4098c0a commit 6a887e3

File tree

2 files changed

+56
-56
lines changed

2 files changed

+56
-56
lines changed

Sources/ParseSwift/Objects/ParseInstallation+async.swift

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public extension ParseInstallation {
2424
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
2525
desires a different policy, it should be inserted in `options`.
2626
*/
27-
func fetch(includeKeys: [String]? = nil,
28-
options: API.Options = []) async throws -> Self {
27+
@discardableResult func fetch(includeKeys: [String]? = nil,
28+
options: API.Options = []) async throws -> Self {
2929
try await withCheckedThrowingContinuation { continuation in
3030
self.fetch(includeKeys: includeKeys,
3131
options: options,
@@ -54,8 +54,8 @@ public extension ParseInstallation {
5454
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
5555
desires a different policy, it should be inserted in `options`.
5656
*/
57-
func save(ignoringCustomObjectIdConfig: Bool = false,
58-
options: API.Options = []) async throws -> Self {
57+
@discardableResult func save(ignoringCustomObjectIdConfig: Bool = false,
58+
options: API.Options = []) async throws -> Self {
5959
try await withCheckedThrowingContinuation { continuation in
6060
self.save(ignoringCustomObjectIdConfig: ignoringCustomObjectIdConfig,
6161
options: options,
@@ -69,7 +69,7 @@ public extension ParseInstallation {
6969
- returns: Returns saved `ParseInstallation`.
7070
- throws: An error of type `ParseError`.
7171
*/
72-
func create(options: API.Options = []) async throws -> Self {
72+
@discardableResult func create(options: API.Options = []) async throws -> Self {
7373
try await withCheckedThrowingContinuation { continuation in
7474
self.create(options: options,
7575
completion: continuation.resume)
@@ -83,7 +83,7 @@ public extension ParseInstallation {
8383
- throws: An error of type `ParseError`.
8484
- important: If an object replaced has the same objectId as current, it will automatically replace the current.
8585
*/
86-
func replace(options: API.Options = []) async throws -> Self {
86+
@discardableResult func replace(options: API.Options = []) async throws -> Self {
8787
try await withCheckedThrowingContinuation { continuation in
8888
self.replace(options: options,
8989
completion: continuation.resume)
@@ -97,7 +97,7 @@ public extension ParseInstallation {
9797
- throws: An error of type `ParseError`.
9898
- important: If an object updated has the same objectId as current, it will automatically update the current.
9999
*/
100-
internal func update(options: API.Options = []) async throws -> Self {
100+
@discardableResult internal func update(options: API.Options = []) async throws -> Self {
101101
try await withCheckedThrowingContinuation { continuation in
102102
self.update(options: options,
103103
completion: continuation.resume)
@@ -135,8 +135,8 @@ public extension Sequence where Element: ParseInstallation {
135135
- throws: An error of type `ParseError`.
136136
- important: If an object fetched has the same objectId as current, it will automatically update the current.
137137
*/
138-
func fetchAll(includeKeys: [String]? = nil,
139-
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
138+
@discardableResult func fetchAll(includeKeys: [String]? = nil,
139+
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
140140
try await withCheckedThrowingContinuation { continuation in
141141
self.fetchAll(includeKeys: includeKeys,
142142
options: options,
@@ -174,10 +174,10 @@ public extension Sequence where Element: ParseInstallation {
174174
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
175175
desires a different policy, it should be inserted in `options`.
176176
*/
177-
func saveAll(batchLimit limit: Int? = nil,
178-
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
179-
ignoringCustomObjectIdConfig: Bool = false,
180-
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
177+
@discardableResult func saveAll(batchLimit limit: Int? = nil,
178+
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
179+
ignoringCustomObjectIdConfig: Bool = false,
180+
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
181181
try await withCheckedThrowingContinuation { continuation in
182182
self.saveAll(batchLimit: limit,
183183
transaction: transaction,
@@ -204,9 +204,9 @@ public extension Sequence where Element: ParseInstallation {
204204
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
205205
desires a different policy, it should be inserted in `options`.
206206
*/
207-
func createAll(batchLimit limit: Int? = nil,
208-
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
209-
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
207+
@discardableResult func createAll(batchLimit limit: Int? = nil,
208+
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
209+
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
210210
try await withCheckedThrowingContinuation { continuation in
211211
self.createAll(batchLimit: limit,
212212
transaction: transaction,
@@ -233,9 +233,9 @@ public extension Sequence where Element: ParseInstallation {
233233
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
234234
desires a different policy, it should be inserted in `options`.
235235
*/
236-
func replaceAll(batchLimit limit: Int? = nil,
237-
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
238-
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
236+
@discardableResult func replaceAll(batchLimit limit: Int? = nil,
237+
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
238+
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
239239
try await withCheckedThrowingContinuation { continuation in
240240
self.replaceAll(batchLimit: limit,
241241
transaction: transaction,
@@ -288,9 +288,9 @@ public extension Sequence where Element: ParseInstallation {
288288
objects in the transaction. The developer should ensure their respective Parse Servers can handle the limit or else
289289
the transactions can fail.
290290
*/
291-
func deleteAll(batchLimit limit: Int? = nil,
292-
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
293-
options: API.Options = []) async throws -> [(Result<Void, ParseError>)] {
291+
@discardableResult func deleteAll(batchLimit limit: Int? = nil,
292+
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
293+
options: API.Options = []) async throws -> [(Result<Void, ParseError>)] {
294294
try await withCheckedThrowingContinuation { continuation in
295295
self.deleteAll(batchLimit: limit,
296296
transaction: transaction,

Sources/ParseSwift/Objects/ParseUser+async.swift

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public extension ParseUser {
2626
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
2727
desires a different policy, it should be inserted in `options`.
2828
*/
29-
static func signup(username: String,
30-
password: String,
31-
options: API.Options = []) async throws -> Self {
29+
@discardableResult static func signup(username: String,
30+
password: String,
31+
options: API.Options = []) async throws -> Self {
3232
try await withCheckedThrowingContinuation { continuation in
3333
Self.signup(username: username,
3434
password: password,
@@ -49,7 +49,7 @@ public extension ParseUser {
4949
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
5050
desires a different policy, it should be inserted in `options`.
5151
*/
52-
func signup(options: API.Options = []) async throws -> Self {
52+
@discardableResult func signup(options: API.Options = []) async throws -> Self {
5353
try await withCheckedThrowingContinuation { continuation in
5454
self.signup(options: options,
5555
completion: continuation.resume)
@@ -69,9 +69,9 @@ public extension ParseUser {
6969
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
7070
desires a different policy, it should be inserted in `options`.
7171
*/
72-
static func login(username: String,
73-
password: String,
74-
options: API.Options = []) async throws -> Self {
72+
@discardableResult static func login(username: String,
73+
password: String,
74+
options: API.Options = []) async throws -> Self {
7575
try await withCheckedThrowingContinuation { continuation in
7676
Self.login(username: username,
7777
password: password,
@@ -93,8 +93,8 @@ public extension ParseUser {
9393
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
9494
desires a different policy, it should be inserted in `options`.
9595
*/
96-
func become(sessionToken: String,
97-
options: API.Options = []) async throws -> Self {
96+
@discardableResult func become(sessionToken: String,
97+
options: API.Options = []) async throws -> Self {
9898
try await withCheckedThrowingContinuation { continuation in
9999
self.become(sessionToken: sessionToken, options: options, completion: continuation.resume)
100100
}
@@ -152,9 +152,9 @@ public extension ParseUser {
152152
[issue](https://github.com/parse-community/parse-server/issues/7784) to be addressed on
153153
the Parse Server, othewise you should set `usingPost = false`.
154154
*/
155-
static func verifyPassword(password: String,
156-
usingPost: Bool = false,
157-
options: API.Options = []) async throws -> Self {
155+
@discardableResult static func verifyPassword(password: String,
156+
usingPost: Bool = false,
157+
options: API.Options = []) async throws -> Self {
158158
try await withCheckedThrowingContinuation { continuation in
159159
Self.verifyPassword(password: password,
160160
usingPost: usingPost,
@@ -193,8 +193,8 @@ public extension ParseUser {
193193
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
194194
desires a different policy, it should be inserted in `options`.
195195
*/
196-
func fetch(includeKeys: [String]? = nil,
197-
options: API.Options = []) async throws -> Self {
196+
@discardableResult func fetch(includeKeys: [String]? = nil,
197+
options: API.Options = []) async throws -> Self {
198198
try await withCheckedThrowingContinuation { continuation in
199199
self.fetch(includeKeys: includeKeys,
200200
options: options,
@@ -223,8 +223,8 @@ public extension ParseUser {
223223
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
224224
desires a different policy, it should be inserted in `options`.
225225
*/
226-
func save(ignoringCustomObjectIdConfig: Bool = false,
227-
options: API.Options = []) async throws -> Self {
226+
@discardableResult func save(ignoringCustomObjectIdConfig: Bool = false,
227+
options: API.Options = []) async throws -> Self {
228228
try await withCheckedThrowingContinuation { continuation in
229229
self.save(ignoringCustomObjectIdConfig: ignoringCustomObjectIdConfig,
230230
options: options,
@@ -240,7 +240,7 @@ public extension ParseUser {
240240
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
241241
desires a different policy, it should be inserted in `options`.
242242
*/
243-
func create(options: API.Options = []) async throws -> Self {
243+
@discardableResult func create(options: API.Options = []) async throws -> Self {
244244
try await withCheckedThrowingContinuation { continuation in
245245
self.create(options: options,
246246
completion: continuation.resume)
@@ -256,7 +256,7 @@ public extension ParseUser {
256256
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
257257
desires a different policy, it should be inserted in `options`.
258258
*/
259-
func replace(options: API.Options = []) async throws -> Self {
259+
@discardableResult func replace(options: API.Options = []) async throws -> Self {
260260
try await withCheckedThrowingContinuation { continuation in
261261
self.replace(options: options,
262262
completion: continuation.resume)
@@ -272,7 +272,7 @@ public extension ParseUser {
272272
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
273273
desires a different policy, it should be inserted in `options`.
274274
*/
275-
internal func update(options: API.Options = []) async throws -> Self {
275+
@discardableResult internal func update(options: API.Options = []) async throws -> Self {
276276
try await withCheckedThrowingContinuation { continuation in
277277
self.update(options: options,
278278
completion: continuation.resume)
@@ -313,8 +313,8 @@ public extension Sequence where Element: ParseUser {
313313
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
314314
desires a different policy, it should be inserted in `options`.
315315
*/
316-
func fetchAll(includeKeys: [String]? = nil,
317-
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
316+
@discardableResult func fetchAll(includeKeys: [String]? = nil,
317+
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
318318
try await withCheckedThrowingContinuation { continuation in
319319
self.fetchAll(includeKeys: includeKeys,
320320
options: options,
@@ -352,10 +352,10 @@ public extension Sequence where Element: ParseUser {
352352
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
353353
desires a different policy, it should be inserted in `options`.
354354
*/
355-
func saveAll(batchLimit limit: Int? = nil,
356-
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
357-
ignoringCustomObjectIdConfig: Bool = false,
358-
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
355+
@discardableResult func saveAll(batchLimit limit: Int? = nil,
356+
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
357+
ignoringCustomObjectIdConfig: Bool = false,
358+
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
359359
try await withCheckedThrowingContinuation { continuation in
360360
self.saveAll(batchLimit: limit,
361361
transaction: transaction,
@@ -382,9 +382,9 @@ public extension Sequence where Element: ParseUser {
382382
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
383383
desires a different policy, it should be inserted in `options`.
384384
*/
385-
func createAll(batchLimit limit: Int? = nil,
386-
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
387-
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
385+
@discardableResult func createAll(batchLimit limit: Int? = nil,
386+
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
387+
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
388388
try await withCheckedThrowingContinuation { continuation in
389389
self.createAll(batchLimit: limit,
390390
transaction: transaction,
@@ -411,9 +411,9 @@ public extension Sequence where Element: ParseUser {
411411
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
412412
desires a different policy, it should be inserted in `options`.
413413
*/
414-
func replaceAll(batchLimit limit: Int? = nil,
415-
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
416-
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
414+
@discardableResult func replaceAll(batchLimit limit: Int? = nil,
415+
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
416+
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
417417
try await withCheckedThrowingContinuation { continuation in
418418
self.replaceAll(batchLimit: limit,
419419
transaction: transaction,
@@ -468,9 +468,9 @@ public extension Sequence where Element: ParseUser {
468468
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
469469
desires a different policy, it should be inserted in `options`.
470470
*/
471-
func deleteAll(batchLimit limit: Int? = nil,
472-
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
473-
options: API.Options = []) async throws -> [(Result<Void, ParseError>)] {
471+
@discardableResult func deleteAll(batchLimit limit: Int? = nil,
472+
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
473+
options: API.Options = []) async throws -> [(Result<Void, ParseError>)] {
474474
try await withCheckedThrowingContinuation { continuation in
475475
self.deleteAll(batchLimit: limit,
476476
transaction: transaction,

0 commit comments

Comments
 (0)