From a790bb751cdad88dbd3b49f42f855bd8f73dc77d Mon Sep 17 00:00:00 2001 From: Corey Date: Sun, 2 Apr 2023 20:29:58 -0400 Subject: [PATCH] feat: Add batch and increment double operation (#88) * feat: Add batch and increment double operation * delete file * make operations Codable. * improve documentation * nits --- CHANGELOG.md | 8 +- ParseSwift.xcodeproj/project.pbxproj | 202 +++++++++++------- README.md | 2 +- Sources/ParseSwift/API/API+Command.swift | 2 +- Sources/ParseSwift/API/BatchUtils.swift | 2 +- Sources/ParseSwift/API/Responses.swift | 2 +- .../3rd Party/ParseApple/ParseApple.swift | 2 +- .../ParseFacebook/ParseFacebook.swift | 2 +- .../3rd Party/ParseGithub/ParseGitHub.swift | 2 +- .../3rd Party/ParseGoogle/ParseGoogle.swift | 2 +- .../ParseInstagram/ParseInstagram.swift | 2 +- .../3rd Party/ParseLDAP/ParseLDAP.swift | 2 +- .../ParseLinkedIn/ParseLinkedIn.swift | 2 +- .../3rd Party/ParseSpotify/ParseSpotify.swift | 2 +- .../3rd Party/ParseTwitter/ParseTwitter.swift | 2 +- .../Internal/ParseAnonymous.swift | 2 +- Sources/ParseSwift/Operations/Add.swift | 14 -- .../ParseSwift/Operations/AddRelation.swift | 18 -- Sources/ParseSwift/Operations/AddUnique.swift | 14 -- Sources/ParseSwift/Operations/Delete.swift | 13 -- Sources/ParseSwift/Operations/Increment.swift | 14 -- Sources/ParseSwift/Operations/Operation.swift | 19 -- Sources/ParseSwift/Operations/Remove.swift | 14 -- .../Operations/RemoveRelation.swift | 18 -- Sources/ParseSwift/ParseConstants.swift | 2 +- .../Protocols/ParseHookFunctionable.swift | 4 +- .../Protocols/ParseHookTriggerable.swift | 4 +- .../Protocols/ParseOperationable.swift | 36 ++++ .../ParseRelationOperationable.swift | 15 ++ .../Types/Operations/ParseOperationAdd.swift | 26 +++ .../ParseOperationAddRelation.swift | 26 +++ .../Operations/ParseOperationAddUnique.swift | 26 +++ .../Operations/ParseOperationBatch.swift | 51 +++++ .../Operations/ParseOperationCommand.swift | 29 +++ .../Operations/ParseOperationDelete.swift | 19 ++ .../Operations/ParseOperationIncrement.swift | 27 +++ .../ParseOperationIncrementDouble.swift | 27 +++ .../Operations/ParseOperationRemove.swift | 26 +++ .../ParseOperationRemoveRelation.swift | 26 +++ Sources/ParseSwift/Types/ParseACL.swift | 2 +- Sources/ParseSwift/Types/ParseCLP.swift | 2 +- Sources/ParseSwift/Types/ParseError.swift | 2 +- Sources/ParseSwift/Types/ParseField.swift | 4 +- Sources/ParseSwift/Types/ParseOperation.swift | 106 ++++++--- .../Apple/ParsePushAppleAlert.swift | 2 +- .../Apple/ParsePushPayloadApple.swift | 4 +- .../Firebase/ParsePushPayloadFirebase.swift | 2 +- .../ParsePushPayloadAny.swift | 2 +- .../ParseSwift/Types/ParsePushStatus.swift | 2 +- Sources/ParseSwift/Types/ParseSchema.swift | 2 +- Sources/ParseSwift/Types/Query.swift | 2 +- .../ParseSwiftTests/KeychainStoreTests.swift | 2 +- Tests/ParseSwiftTests/ParseCLPTests.swift | 2 +- .../ParseObjectAsyncTests.swift | 2 +- .../ParseOperationAsyncTests.swift | 2 +- .../ParseSwiftTests/ParseOperationTests.swift | 66 ++++++ Tests/ParseSwiftTests/ParsePushTests.swift | 2 +- .../ParseQueryAsyncTests.swift | 2 +- Tests/ParseSwiftTests/ParseSchemaTests.swift | 4 +- 59 files changed, 648 insertions(+), 272 deletions(-) delete mode 100644 Sources/ParseSwift/Operations/Add.swift delete mode 100644 Sources/ParseSwift/Operations/AddRelation.swift delete mode 100644 Sources/ParseSwift/Operations/AddUnique.swift delete mode 100644 Sources/ParseSwift/Operations/Delete.swift delete mode 100644 Sources/ParseSwift/Operations/Increment.swift delete mode 100644 Sources/ParseSwift/Operations/Operation.swift delete mode 100644 Sources/ParseSwift/Operations/Remove.swift delete mode 100644 Sources/ParseSwift/Operations/RemoveRelation.swift create mode 100644 Sources/ParseSwift/Protocols/ParseOperationable.swift create mode 100644 Sources/ParseSwift/Protocols/ParseRelationOperationable.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationAdd.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationAddRelation.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationAddUnique.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationBatch.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationCommand.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationDelete.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationIncrement.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationIncrementDouble.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationRemove.swift create mode 100644 Sources/ParseSwift/Types/Operations/ParseOperationRemoveRelation.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index f6dc67cd0..fb5e7da61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,15 @@ # Parse-Swift Changelog ### main -[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.3.3...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift) +[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.4.0...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift) * _Contributing to this repo? Add info about your change here to be included in the next release_ +### 5.4.0 +[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.3.3...5.4.0), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.4.0/documentation/parseswift) + +__New features__ +* Add batch and increment double operations. All operations have also been made public so developers can build batch operations with ParseOperationBatch ([#88](https://github.com/netreconlab/Parse-Swift/pull/88)), thanks to [Corey Baker](https://github.com/cbaker6). + ### 5.3.3 [Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.3.2...5.3.3), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.3.3/documentation/parseswift) diff --git a/ParseSwift.xcodeproj/project.pbxproj b/ParseSwift.xcodeproj/project.pbxproj index c63a866d9..0d7f1e8b7 100644 --- a/ParseSwift.xcodeproj/project.pbxproj +++ b/ParseSwift.xcodeproj/project.pbxproj @@ -515,10 +515,10 @@ 709A148828396B1D00BF85E5 /* ParseField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148628396B1C00BF85E5 /* ParseField.swift */; }; 709A148928396B1D00BF85E5 /* ParseField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148628396B1C00BF85E5 /* ParseField.swift */; }; 709A148A28396B1D00BF85E5 /* ParseField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148628396B1C00BF85E5 /* ParseField.swift */; }; - 709A148C2839A1DB00BF85E5 /* Operation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148B2839A1DB00BF85E5 /* Operation.swift */; }; - 709A148D2839A1DB00BF85E5 /* Operation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148B2839A1DB00BF85E5 /* Operation.swift */; }; - 709A148E2839A1DB00BF85E5 /* Operation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148B2839A1DB00BF85E5 /* Operation.swift */; }; - 709A148F2839A1DB00BF85E5 /* Operation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148B2839A1DB00BF85E5 /* Operation.swift */; }; + 709A148C2839A1DB00BF85E5 /* ParseOperationCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148B2839A1DB00BF85E5 /* ParseOperationCommand.swift */; }; + 709A148D2839A1DB00BF85E5 /* ParseOperationCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148B2839A1DB00BF85E5 /* ParseOperationCommand.swift */; }; + 709A148E2839A1DB00BF85E5 /* ParseOperationCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148B2839A1DB00BF85E5 /* ParseOperationCommand.swift */; }; + 709A148F2839A1DB00BF85E5 /* ParseOperationCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A148B2839A1DB00BF85E5 /* ParseOperationCommand.swift */; }; 709A14A02839CABD00BF85E5 /* ParseCLP.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A149F2839CABD00BF85E5 /* ParseCLP.swift */; }; 709A14A12839CABD00BF85E5 /* ParseCLP.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A149F2839CABD00BF85E5 /* ParseCLP.swift */; }; 709A14A22839CABD00BF85E5 /* ParseCLP.swift in Sources */ = {isa = PBXBuildFile; fileRef = 709A149F2839CABD00BF85E5 /* ParseCLP.swift */; }; @@ -618,14 +618,14 @@ 70C5508525B4A68700B5DBC2 /* ParseOperationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5508425B4A68700B5DBC2 /* ParseOperationTests.swift */; }; 70C5508625B4A68700B5DBC2 /* ParseOperationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5508425B4A68700B5DBC2 /* ParseOperationTests.swift */; }; 70C5508725B4A68700B5DBC2 /* ParseOperationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5508425B4A68700B5DBC2 /* ParseOperationTests.swift */; }; - 70C5509225B4A99100B5DBC2 /* AddRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509125B4A99100B5DBC2 /* AddRelation.swift */; }; - 70C5509325B4A99100B5DBC2 /* AddRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509125B4A99100B5DBC2 /* AddRelation.swift */; }; - 70C5509425B4A99100B5DBC2 /* AddRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509125B4A99100B5DBC2 /* AddRelation.swift */; }; - 70C5509525B4A99100B5DBC2 /* AddRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509125B4A99100B5DBC2 /* AddRelation.swift */; }; - 70C550A025B4A9F600B5DBC2 /* RemoveRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509F25B4A9F600B5DBC2 /* RemoveRelation.swift */; }; - 70C550A125B4A9F600B5DBC2 /* RemoveRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509F25B4A9F600B5DBC2 /* RemoveRelation.swift */; }; - 70C550A225B4A9F600B5DBC2 /* RemoveRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509F25B4A9F600B5DBC2 /* RemoveRelation.swift */; }; - 70C550A325B4A9F600B5DBC2 /* RemoveRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509F25B4A9F600B5DBC2 /* RemoveRelation.swift */; }; + 70C5509225B4A99100B5DBC2 /* ParseOperationAddRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509125B4A99100B5DBC2 /* ParseOperationAddRelation.swift */; }; + 70C5509325B4A99100B5DBC2 /* ParseOperationAddRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509125B4A99100B5DBC2 /* ParseOperationAddRelation.swift */; }; + 70C5509425B4A99100B5DBC2 /* ParseOperationAddRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509125B4A99100B5DBC2 /* ParseOperationAddRelation.swift */; }; + 70C5509525B4A99100B5DBC2 /* ParseOperationAddRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509125B4A99100B5DBC2 /* ParseOperationAddRelation.swift */; }; + 70C550A025B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509F25B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift */; }; + 70C550A125B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509F25B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift */; }; + 70C550A225B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509F25B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift */; }; + 70C550A325B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C5509F25B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift */; }; 70C7DC1E24D20E530050419B /* ParseUserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C7DC1D24D20E530050419B /* ParseUserTests.swift */; }; 70C7DC2124D20F190050419B /* ParseQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C7DC1F24D20F180050419B /* ParseQueryTests.swift */; }; 70C7DC2224D20F190050419B /* ParseObjectBatchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C7DC2024D20F190050419B /* ParseObjectBatchTests.swift */; }; @@ -919,6 +919,22 @@ 91679D6D268F261800F71809 /* ParseVersionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91679D68268F25EA00F71809 /* ParseVersionTests.swift */; }; 91679D6E268F261900F71809 /* ParseVersionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91679D68268F25EA00F71809 /* ParseVersionTests.swift */; }; 91679D6F268F261A00F71809 /* ParseVersionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91679D68268F25EA00F71809 /* ParseVersionTests.swift */; }; + 916E206B29D8C3E600C21EC6 /* ParseOperationBatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E206A29D8C3E600C21EC6 /* ParseOperationBatch.swift */; }; + 916E206C29D8C3E600C21EC6 /* ParseOperationBatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E206A29D8C3E600C21EC6 /* ParseOperationBatch.swift */; }; + 916E206D29D8C3E600C21EC6 /* ParseOperationBatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E206A29D8C3E600C21EC6 /* ParseOperationBatch.swift */; }; + 916E206E29D8C3E600C21EC6 /* ParseOperationBatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E206A29D8C3E600C21EC6 /* ParseOperationBatch.swift */; }; + 916E207029D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E206F29D8C83100C21EC6 /* ParseRelationOperationable.swift */; }; + 916E207129D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E206F29D8C83100C21EC6 /* ParseRelationOperationable.swift */; }; + 916E207229D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E206F29D8C83100C21EC6 /* ParseRelationOperationable.swift */; }; + 916E207329D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E206F29D8C83100C21EC6 /* ParseRelationOperationable.swift */; }; + 916E207529D8CDFB00C21EC6 /* ParseOperationable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E207429D8CDFB00C21EC6 /* ParseOperationable.swift */; }; + 916E207629D8CDFB00C21EC6 /* ParseOperationable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E207429D8CDFB00C21EC6 /* ParseOperationable.swift */; }; + 916E207729D8CDFB00C21EC6 /* ParseOperationable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E207429D8CDFB00C21EC6 /* ParseOperationable.swift */; }; + 916E207829D8CDFB00C21EC6 /* ParseOperationable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E207429D8CDFB00C21EC6 /* ParseOperationable.swift */; }; + 916E207F29D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E207E29D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift */; }; + 916E208029D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E207E29D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift */; }; + 916E208129D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E207E29D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift */; }; + 916E208229D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916E207E29D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift */; }; 917BA4262703DB4600F8D747 /* ParseQueryAsyncTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 917BA4252703DB4600F8D747 /* ParseQueryAsyncTests.swift */; }; 917BA4272703DB4600F8D747 /* ParseQueryAsyncTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 917BA4252703DB4600F8D747 /* ParseQueryAsyncTests.swift */; }; 917BA4282703DB4600F8D747 /* ParseQueryAsyncTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 917BA4252703DB4600F8D747 /* ParseQueryAsyncTests.swift */; }; @@ -1098,26 +1114,26 @@ F97B464724D9C78B00F4A88B /* ParseOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464024D9C78B00F4A88B /* ParseOperation.swift */; }; F97B464824D9C78B00F4A88B /* ParseOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464024D9C78B00F4A88B /* ParseOperation.swift */; }; F97B464924D9C78B00F4A88B /* ParseOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464024D9C78B00F4A88B /* ParseOperation.swift */; }; - F97B464A24D9C78B00F4A88B /* Delete.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464124D9C78B00F4A88B /* Delete.swift */; }; - F97B464B24D9C78B00F4A88B /* Delete.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464124D9C78B00F4A88B /* Delete.swift */; }; - F97B464C24D9C78B00F4A88B /* Delete.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464124D9C78B00F4A88B /* Delete.swift */; }; - F97B464D24D9C78B00F4A88B /* Delete.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464124D9C78B00F4A88B /* Delete.swift */; }; - F97B464E24D9C78B00F4A88B /* Add.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464224D9C78B00F4A88B /* Add.swift */; }; - F97B464F24D9C78B00F4A88B /* Add.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464224D9C78B00F4A88B /* Add.swift */; }; - F97B465024D9C78B00F4A88B /* Add.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464224D9C78B00F4A88B /* Add.swift */; }; - F97B465124D9C78C00F4A88B /* Add.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464224D9C78B00F4A88B /* Add.swift */; }; - F97B465224D9C78C00F4A88B /* AddUnique.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464324D9C78B00F4A88B /* AddUnique.swift */; }; - F97B465324D9C78C00F4A88B /* AddUnique.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464324D9C78B00F4A88B /* AddUnique.swift */; }; - F97B465424D9C78C00F4A88B /* AddUnique.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464324D9C78B00F4A88B /* AddUnique.swift */; }; - F97B465524D9C78C00F4A88B /* AddUnique.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464324D9C78B00F4A88B /* AddUnique.swift */; }; - F97B465624D9C78C00F4A88B /* Remove.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464424D9C78B00F4A88B /* Remove.swift */; }; - F97B465724D9C78C00F4A88B /* Remove.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464424D9C78B00F4A88B /* Remove.swift */; }; - F97B465824D9C78C00F4A88B /* Remove.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464424D9C78B00F4A88B /* Remove.swift */; }; - F97B465924D9C78C00F4A88B /* Remove.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464424D9C78B00F4A88B /* Remove.swift */; }; - F97B465A24D9C78C00F4A88B /* Increment.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464524D9C78B00F4A88B /* Increment.swift */; }; - F97B465B24D9C78C00F4A88B /* Increment.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464524D9C78B00F4A88B /* Increment.swift */; }; - F97B465C24D9C78C00F4A88B /* Increment.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464524D9C78B00F4A88B /* Increment.swift */; }; - F97B465D24D9C78C00F4A88B /* Increment.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464524D9C78B00F4A88B /* Increment.swift */; }; + F97B464A24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464124D9C78B00F4A88B /* ParseOperationDelete.swift */; }; + F97B464B24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464124D9C78B00F4A88B /* ParseOperationDelete.swift */; }; + F97B464C24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464124D9C78B00F4A88B /* ParseOperationDelete.swift */; }; + F97B464D24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464124D9C78B00F4A88B /* ParseOperationDelete.swift */; }; + F97B464E24D9C78B00F4A88B /* ParseOperationAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464224D9C78B00F4A88B /* ParseOperationAdd.swift */; }; + F97B464F24D9C78B00F4A88B /* ParseOperationAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464224D9C78B00F4A88B /* ParseOperationAdd.swift */; }; + F97B465024D9C78B00F4A88B /* ParseOperationAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464224D9C78B00F4A88B /* ParseOperationAdd.swift */; }; + F97B465124D9C78C00F4A88B /* ParseOperationAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464224D9C78B00F4A88B /* ParseOperationAdd.swift */; }; + F97B465224D9C78C00F4A88B /* ParseOperationAddUnique.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464324D9C78B00F4A88B /* ParseOperationAddUnique.swift */; }; + F97B465324D9C78C00F4A88B /* ParseOperationAddUnique.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464324D9C78B00F4A88B /* ParseOperationAddUnique.swift */; }; + F97B465424D9C78C00F4A88B /* ParseOperationAddUnique.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464324D9C78B00F4A88B /* ParseOperationAddUnique.swift */; }; + F97B465524D9C78C00F4A88B /* ParseOperationAddUnique.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464324D9C78B00F4A88B /* ParseOperationAddUnique.swift */; }; + F97B465624D9C78C00F4A88B /* ParseOperationRemove.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464424D9C78B00F4A88B /* ParseOperationRemove.swift */; }; + F97B465724D9C78C00F4A88B /* ParseOperationRemove.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464424D9C78B00F4A88B /* ParseOperationRemove.swift */; }; + F97B465824D9C78C00F4A88B /* ParseOperationRemove.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464424D9C78B00F4A88B /* ParseOperationRemove.swift */; }; + F97B465924D9C78C00F4A88B /* ParseOperationRemove.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464424D9C78B00F4A88B /* ParseOperationRemove.swift */; }; + F97B465A24D9C78C00F4A88B /* ParseOperationIncrement.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464524D9C78B00F4A88B /* ParseOperationIncrement.swift */; }; + F97B465B24D9C78C00F4A88B /* ParseOperationIncrement.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464524D9C78B00F4A88B /* ParseOperationIncrement.swift */; }; + F97B465C24D9C78C00F4A88B /* ParseOperationIncrement.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464524D9C78B00F4A88B /* ParseOperationIncrement.swift */; }; + F97B465D24D9C78C00F4A88B /* ParseOperationIncrement.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B464524D9C78B00F4A88B /* ParseOperationIncrement.swift */; }; F97B465F24D9C7B500F4A88B /* KeychainStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B465E24D9C7B500F4A88B /* KeychainStore.swift */; }; F97B466024D9C7B500F4A88B /* KeychainStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B465E24D9C7B500F4A88B /* KeychainStore.swift */; }; F97B466124D9C7B500F4A88B /* KeychainStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F97B465E24D9C7B500F4A88B /* KeychainStore.swift */; }; @@ -1325,7 +1341,7 @@ 709A147C283949D100BF85E5 /* ParseSchema.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseSchema.swift; sourceTree = ""; }; 709A148128395ED100BF85E5 /* ParseSchema+async.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ParseSchema+async.swift"; sourceTree = ""; }; 709A148628396B1C00BF85E5 /* ParseField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseField.swift; sourceTree = ""; }; - 709A148B2839A1DB00BF85E5 /* Operation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Operation.swift; sourceTree = ""; }; + 709A148B2839A1DB00BF85E5 /* ParseOperationCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseOperationCommand.swift; sourceTree = ""; }; 709A149F2839CABD00BF85E5 /* ParseCLP.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseCLP.swift; sourceTree = ""; }; 709A14A4283AAF4C00BF85E5 /* ParseSchema+combine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ParseSchema+combine.swift"; sourceTree = ""; }; 709B40C0268F999000ED2EAC /* IOS13Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IOS13Tests.swift; sourceTree = ""; }; @@ -1351,8 +1367,8 @@ 70C5504525B40D5200B5DBC2 /* ParseSessionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseSessionTests.swift; sourceTree = ""; }; 70C5507625B49D3A00B5DBC2 /* ParseRole.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseRole.swift; sourceTree = ""; }; 70C5508425B4A68700B5DBC2 /* ParseOperationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseOperationTests.swift; sourceTree = ""; }; - 70C5509125B4A99100B5DBC2 /* AddRelation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddRelation.swift; sourceTree = ""; }; - 70C5509F25B4A9F600B5DBC2 /* RemoveRelation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoveRelation.swift; sourceTree = ""; }; + 70C5509125B4A99100B5DBC2 /* ParseOperationAddRelation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseOperationAddRelation.swift; sourceTree = ""; }; + 70C5509F25B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseOperationRemoveRelation.swift; sourceTree = ""; }; 70C7DC1D24D20E530050419B /* ParseUserTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseUserTests.swift; sourceTree = ""; }; 70C7DC1F24D20F180050419B /* ParseQueryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseQueryTests.swift; sourceTree = ""; }; 70C7DC2024D20F190050419B /* ParseObjectBatchTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseObjectBatchTests.swift; sourceTree = ""; }; @@ -1450,6 +1466,10 @@ 916786EF259BC59600BB5B4E /* ParseCloudableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseCloudableTests.swift; sourceTree = ""; }; 91679D63268E596300F71809 /* ParseVersion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseVersion.swift; sourceTree = ""; }; 91679D68268F25EA00F71809 /* ParseVersionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseVersionTests.swift; sourceTree = ""; }; + 916E206A29D8C3E600C21EC6 /* ParseOperationBatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseOperationBatch.swift; sourceTree = ""; }; + 916E206F29D8C83100C21EC6 /* ParseRelationOperationable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseRelationOperationable.swift; sourceTree = ""; }; + 916E207429D8CDFB00C21EC6 /* ParseOperationable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseOperationable.swift; sourceTree = ""; }; + 916E207E29D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseOperationIncrementDouble.swift; sourceTree = ""; }; 917BA4252703DB4600F8D747 /* ParseQueryAsyncTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseQueryAsyncTests.swift; sourceTree = ""; }; 917BA4292703E03F00F8D747 /* ParseAnalyticsAsyncTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseAnalyticsAsyncTests.swift; sourceTree = ""; }; 917BA42D2703E20E00F8D747 /* ParseCloudableAsyncTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseCloudableAsyncTests.swift; sourceTree = ""; }; @@ -1500,11 +1520,11 @@ F97B462D24D9C74400F4A88B /* Responses.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Responses.swift; sourceTree = ""; }; F97B462E24D9C74400F4A88B /* API+Command.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "API+Command.swift"; sourceTree = ""; }; F97B464024D9C78B00F4A88B /* ParseOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseOperation.swift; sourceTree = ""; }; - F97B464124D9C78B00F4A88B /* Delete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Delete.swift; sourceTree = ""; }; - F97B464224D9C78B00F4A88B /* Add.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Add.swift; sourceTree = ""; }; - F97B464324D9C78B00F4A88B /* AddUnique.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddUnique.swift; sourceTree = ""; }; - F97B464424D9C78B00F4A88B /* Remove.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Remove.swift; sourceTree = ""; }; - F97B464524D9C78B00F4A88B /* Increment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Increment.swift; sourceTree = ""; }; + F97B464124D9C78B00F4A88B /* ParseOperationDelete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseOperationDelete.swift; sourceTree = ""; }; + F97B464224D9C78B00F4A88B /* ParseOperationAdd.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseOperationAdd.swift; sourceTree = ""; }; + F97B464324D9C78B00F4A88B /* ParseOperationAddUnique.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseOperationAddUnique.swift; sourceTree = ""; }; + F97B464424D9C78B00F4A88B /* ParseOperationRemove.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseOperationRemove.swift; sourceTree = ""; }; + F97B464524D9C78B00F4A88B /* ParseOperationIncrement.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseOperationIncrement.swift; sourceTree = ""; }; F97B465E24D9C7B500F4A88B /* KeychainStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeychainStore.swift; sourceTree = ""; }; F97B466324D9C88600F4A88B /* SecureStorable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecureStorable.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1786,7 +1806,6 @@ 70110D5D250849B30091CC1D /* InternalObjects */, 70510AAA259EE23700FEA700 /* LiveQuery */, F97B45C324D9C6F200F4A88B /* Objects */, - F97B463F24D9C78B00F4A88B /* Operations */, 70110D5E25084AF80091CC1D /* Protocols */, F97B45CB24D9C6F200F4A88B /* Storage */, F97B45BA24D9C6F200F4A88B /* Types */, @@ -1852,10 +1871,12 @@ 70CE0ACA285FD5CB00DAEA86 /* ParseHookTriggerable+async.swift */, 70CE0ACF285FD5D700DAEA86 /* ParseHookTriggerable+combine.swift */, 70B412B829801B8B00F706EA /* ParseHookTriggerRequestable.swift */, + 916E207429D8CDFB00C21EC6 /* ParseOperationable.swift */, 705025EA285153BC008D6624 /* ParsePushApplePayloadable.swift */, 705025EF2851542D008D6624 /* ParsePushFirebasePayloadable.swift */, 705025CB284CE4C2008D6624 /* ParsePushPayloadable.swift */, 70A98D812794AB3C009B58F2 /* ParseQueryScorable.swift */, + 916E206F29D8C83100C21EC6 /* ParseRelationOperationable.swift */, 70CE0ABB285F8FF900DAEA86 /* ParseTypeable.swift */, F97B45C824D9C6F200F4A88B /* Queryable.swift */, 91BB8FCE2690BA70005A6BA5 /* QueryObservable.swift */, @@ -2208,6 +2229,7 @@ 70B4E0BB2762F1D5004C9757 /* QueryConstraint.swift */, 91BB8FC92690AC99005A6BA5 /* QueryViewModel.swift */, 70B4E0C02762F313004C9757 /* QueryWhere.swift */, + F97B463F24D9C78B00F4A88B /* Operations */, 705025E428514E91008D6624 /* ParsePushPayload */, ); path = Types; @@ -2265,14 +2287,16 @@ F97B463F24D9C78B00F4A88B /* Operations */ = { isa = PBXGroup; children = ( - F97B464224D9C78B00F4A88B /* Add.swift */, - 70C5509125B4A99100B5DBC2 /* AddRelation.swift */, - F97B464324D9C78B00F4A88B /* AddUnique.swift */, - F97B464124D9C78B00F4A88B /* Delete.swift */, - F97B464524D9C78B00F4A88B /* Increment.swift */, - F97B464424D9C78B00F4A88B /* Remove.swift */, - 70C5509F25B4A9F600B5DBC2 /* RemoveRelation.swift */, - 709A148B2839A1DB00BF85E5 /* Operation.swift */, + F97B464224D9C78B00F4A88B /* ParseOperationAdd.swift */, + 70C5509125B4A99100B5DBC2 /* ParseOperationAddRelation.swift */, + F97B464324D9C78B00F4A88B /* ParseOperationAddUnique.swift */, + 916E206A29D8C3E600C21EC6 /* ParseOperationBatch.swift */, + 709A148B2839A1DB00BF85E5 /* ParseOperationCommand.swift */, + F97B464124D9C78B00F4A88B /* ParseOperationDelete.swift */, + F97B464524D9C78B00F4A88B /* ParseOperationIncrement.swift */, + 916E207E29D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift */, + F97B464424D9C78B00F4A88B /* ParseOperationRemove.swift */, + 70C5509F25B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift */, ); path = Operations; sourceTree = ""; @@ -2704,7 +2728,7 @@ 70CE0AC6285FD5A800DAEA86 /* ParseHookFunctionable+combine.swift in Sources */, 91F346B9269B766C005727B6 /* CloudViewModel.swift in Sources */, 708EF0C228D5FDF10052EF35 /* API+NonParseBodyCommand+async.swift in Sources */, - 709A148C2839A1DB00BF85E5 /* Operation.swift in Sources */, + 709A148C2839A1DB00BF85E5 /* ParseOperationCommand.swift in Sources */, 70CE0AD0285FD5D700DAEA86 /* ParseHookTriggerable+combine.swift in Sources */, 709A14A5283AAF4C00BF85E5 /* ParseSchema+combine.swift in Sources */, F97B461624D9C6F200F4A88B /* Queryable.swift in Sources */, @@ -2729,7 +2753,7 @@ 703B08FD26BD953B005A112F /* ParseHealth+async.swift in Sources */, 7085DDA326CC8A470033B977 /* ParseHealth+combine.swift in Sources */, 70CE0AC1285FD59B00DAEA86 /* ParseHookFunctionable+async.swift in Sources */, - F97B465224D9C78C00F4A88B /* AddUnique.swift in Sources */, + F97B465224D9C78C00F4A88B /* ParseOperationAddUnique.swift in Sources */, 70C048C12880D7E600401689 /* Dictionary.swift in Sources */, 91B79AC826EE3C5D00073F2C /* API+BatchCommand.swift in Sources */, 70385E712858D2DD0084D306 /* ParseHookTriggerable.swift in Sources */, @@ -2770,11 +2794,12 @@ 70F79A192639CE6F00731C46 /* ParseHealth.swift in Sources */, 7030E07E29BB8CDC0021970D /* ParseConfigCodable.swift in Sources */, 70212D132854C82B00386163 /* ParsePushFirebaseNotification.swift in Sources */, + 916E206B29D8C3E600C21EC6 /* ParseOperationBatch.swift in Sources */, 7044C19F25C4FA870011F6E7 /* ParseOperation+combine.swift in Sources */, F97B461E24D9C6F200F4A88B /* ParseStorage.swift in Sources */, 7044C1AD25C4FC080011F6E7 /* Query+combine.swift in Sources */, F97B45D224D9C6F200F4A88B /* AnyDecodable.swift in Sources */, - 70C550A025B4A9F600B5DBC2 /* RemoveRelation.swift in Sources */, + 70C550A025B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift in Sources */, 705025BD284C610C008D6624 /* ParsePush.swift in Sources */, F97B463B24D9C74400F4A88B /* API+Command.swift in Sources */, F97B464624D9C78B00F4A88B /* ParseOperation.swift in Sources */, @@ -2786,16 +2811,17 @@ 89899D342603CF36002E2043 /* ParseTwitter.swift in Sources */, 7C55F9F12860CEEF002A352D /* ParseSpotify+combine.swift in Sources */, 704C886C28BE69A8008E6B01 /* ParseConfiguration.swift in Sources */, + 916E207029D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */, 70B4E0BC2762F1D5004C9757 /* QueryConstraint.swift in Sources */, 70C167B427304F09009F4E30 /* Pointer+async.swift in Sources */, 705025AE28456106008D6624 /* ParsePushStatusable.swift in Sources */, - F97B464A24D9C78B00F4A88B /* Delete.swift in Sources */, + F97B464A24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */, 705025CC284CE4C2008D6624 /* ParsePushPayloadable.swift in Sources */, 70F03A4D2780D28A00E5AFB4 /* ParseLinkedIn+combine.swift in Sources */, F97B460624D9C6F200F4A88B /* ParseUser.swift in Sources */, 70F03A3E2780CA8F00E5AFB4 /* ParseGitHub+combine.swift in Sources */, 700396F825A394AE0052CB31 /* ParseLiveQueryDelegate.swift in Sources */, - F97B465A24D9C78C00F4A88B /* Increment.swift in Sources */, + F97B465A24D9C78C00F4A88B /* ParseOperationIncrement.swift in Sources */, 7045769326BD8F8100F86F71 /* ParseInstallation+async.swift in Sources */, 7C55F9E72860CD6B002A352D /* ParseSpotify.swift in Sources */, 7003960925A184EF0052CB31 /* ParseLiveQuery.swift in Sources */, @@ -2819,7 +2845,7 @@ F97B45E624D9C6F200F4A88B /* Query.swift in Sources */, 703B093526BF43D9005A112F /* ParseAnonymous+async.swift in Sources */, 705D950825BE4C08003EF6F8 /* SubscriptionCallback.swift in Sources */, - 70C5509225B4A99100B5DBC2 /* AddRelation.swift in Sources */, + 70C5509225B4A99100B5DBC2 /* ParseOperationAddRelation.swift in Sources */, 708D035225215F9B00646C70 /* Deletable.swift in Sources */, F97B466424D9C88600F4A88B /* SecureStorable.swift in Sources */, 7030E08B29BBBF790021970D /* ParseConfigCodable+async.swift in Sources */, @@ -2829,6 +2855,7 @@ 91F346BE269B77B5005727B6 /* CloudObservable.swift in Sources */, F97B462F24D9C74400F4A88B /* BatchUtils.swift in Sources */, 70385E802858EAA90084D306 /* ParseHookFunctionRequest.swift in Sources */, + 916E207529D8CDFB00C21EC6 /* ParseOperationable.swift in Sources */, 70CE0AAD28595FDE00DAEA86 /* ParseHookRequestable+combine.swift in Sources */, 4A82B7F61F254CCE0063D731 /* Parse.swift in Sources */, F97B45EA24D9C6F200F4A88B /* ParseGeoPoint.swift in Sources */, @@ -2848,13 +2875,14 @@ F97B45F624D9C6F200F4A88B /* ParseError.swift in Sources */, 7045769D26BD934000F86F71 /* ParseFile+async.swift in Sources */, F97B463324D9C74400F4A88B /* URLSession.swift in Sources */, - F97B464E24D9C78B00F4A88B /* Add.swift in Sources */, + F97B464E24D9C78B00F4A88B /* ParseOperationAdd.swift in Sources */, 70D41D8028B520E200613510 /* ParseKeychainAccessGroup.swift in Sources */, 70385E762858E1000084D306 /* ParseHookFunctionable.swift in Sources */, 703B095326BF47FD005A112F /* ParseTwitter+async.swift in Sources */, 7051E2E22986F10D00ABFC7E /* SocketTasks.swift in Sources */, 70CE0ABC285F8FF900DAEA86 /* ParseTypeable.swift in Sources */, 70BC9890252A5B5C00FF3074 /* Objectable.swift in Sources */, + 916E207F29D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift in Sources */, F97B45FE24D9C6F200F4A88B /* ParseFile.swift in Sources */, F97B45EE24D9C6F200F4A88B /* BaseParseUser.swift in Sources */, 706436A427341F6E007C6461 /* Encodable.swift in Sources */, @@ -2869,7 +2897,7 @@ 703B094926BF47D0005A112F /* ParseLDAP+async.swift in Sources */, F97B45CE24D9C6F200F4A88B /* ParseCoding.swift in Sources */, 70CE0AA828595FCE00DAEA86 /* ParseHookRequestable+async.swift in Sources */, - F97B465624D9C78C00F4A88B /* Remove.swift in Sources */, + F97B465624D9C78C00F4A88B /* ParseOperationRemove.swift in Sources */, F97B45FA24D9C6F200F4A88B /* ParseACL.swift in Sources */, 7016ED6425C4C46B00038648 /* ParseObject+combine.swift in Sources */, 705025F02851542D008D6624 /* ParsePushFirebasePayloadable.swift in Sources */, @@ -3022,7 +3050,7 @@ 70CE0AC7285FD5A800DAEA86 /* ParseHookFunctionable+combine.swift in Sources */, 91F346BA269B766D005727B6 /* CloudViewModel.swift in Sources */, 708EF0C328D5FDF10052EF35 /* API+NonParseBodyCommand+async.swift in Sources */, - 709A148D2839A1DB00BF85E5 /* Operation.swift in Sources */, + 709A148D2839A1DB00BF85E5 /* ParseOperationCommand.swift in Sources */, 70CE0AD1285FD5D700DAEA86 /* ParseHookTriggerable+combine.swift in Sources */, 709A14A6283AAF4C00BF85E5 /* ParseSchema+combine.swift in Sources */, F97B461724D9C6F200F4A88B /* Queryable.swift in Sources */, @@ -3047,7 +3075,7 @@ 703B08FE26BD953B005A112F /* ParseHealth+async.swift in Sources */, 7085DDA426CC8A470033B977 /* ParseHealth+combine.swift in Sources */, 70CE0AC2285FD59B00DAEA86 /* ParseHookFunctionable+async.swift in Sources */, - F97B465324D9C78C00F4A88B /* AddUnique.swift in Sources */, + F97B465324D9C78C00F4A88B /* ParseOperationAddUnique.swift in Sources */, 70C048C22880D7E600401689 /* Dictionary.swift in Sources */, 91B79AC926EE3C5D00073F2C /* API+BatchCommand.swift in Sources */, 70385E722858D2DD0084D306 /* ParseHookTriggerable.swift in Sources */, @@ -3088,9 +3116,10 @@ F97B461F24D9C6F200F4A88B /* ParseStorage.swift in Sources */, 7030E07F29BB8CDC0021970D /* ParseConfigCodable.swift in Sources */, 70212D142854C82B00386163 /* ParsePushFirebaseNotification.swift in Sources */, + 916E206C29D8C3E600C21EC6 /* ParseOperationBatch.swift in Sources */, 7044C1AE25C4FC080011F6E7 /* Query+combine.swift in Sources */, F97B45D324D9C6F200F4A88B /* AnyDecodable.swift in Sources */, - 70C550A125B4A9F600B5DBC2 /* RemoveRelation.swift in Sources */, + 70C550A125B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift in Sources */, F97B463C24D9C74400F4A88B /* API+Command.swift in Sources */, F97B464724D9C78B00F4A88B /* ParseOperation.swift in Sources */, 705025BE284C610C008D6624 /* ParsePush.swift in Sources */, @@ -3104,15 +3133,16 @@ 70B4E0BD2762F1D5004C9757 /* QueryConstraint.swift in Sources */, 7C55F9F22860CEEF002A352D /* ParseSpotify+combine.swift in Sources */, 704C886D28BE69A8008E6B01 /* ParseConfiguration.swift in Sources */, + 916E207129D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */, 70C167B527304F09009F4E30 /* Pointer+async.swift in Sources */, - F97B464B24D9C78B00F4A88B /* Delete.swift in Sources */, + F97B464B24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */, 705025AF28456106008D6624 /* ParsePushStatusable.swift in Sources */, F97B460724D9C6F200F4A88B /* ParseUser.swift in Sources */, 705025CD284CE4C2008D6624 /* ParsePushPayloadable.swift in Sources */, 70F03A4E2780D28A00E5AFB4 /* ParseLinkedIn+combine.swift in Sources */, 700396F925A394AE0052CB31 /* ParseLiveQueryDelegate.swift in Sources */, 70F03A3F2780CA8F00E5AFB4 /* ParseGitHub+combine.swift in Sources */, - F97B465B24D9C78C00F4A88B /* Increment.swift in Sources */, + F97B465B24D9C78C00F4A88B /* ParseOperationIncrement.swift in Sources */, 7045769426BD8F8100F86F71 /* ParseInstallation+async.swift in Sources */, 7003960A25A184EF0052CB31 /* ParseLiveQuery.swift in Sources */, 7C55F9E82860CD6B002A352D /* ParseSpotify.swift in Sources */, @@ -3136,7 +3166,7 @@ F97B45E724D9C6F200F4A88B /* Query.swift in Sources */, 703B093626BF43D9005A112F /* ParseAnonymous+async.swift in Sources */, 705D950925BE4C08003EF6F8 /* SubscriptionCallback.swift in Sources */, - 70C5509325B4A99100B5DBC2 /* AddRelation.swift in Sources */, + 70C5509325B4A99100B5DBC2 /* ParseOperationAddRelation.swift in Sources */, 708D035325215F9B00646C70 /* Deletable.swift in Sources */, F97B466524D9C88600F4A88B /* SecureStorable.swift in Sources */, 7004C22125B63C7A005E0AD9 /* ParseRelation.swift in Sources */, @@ -3147,6 +3177,7 @@ F97B463024D9C74400F4A88B /* BatchUtils.swift in Sources */, 4AFDA72A1F26DAE1002AE4FC /* Parse.swift in Sources */, 70385E812858EAA90084D306 /* ParseHookFunctionRequest.swift in Sources */, + 916E207629D8CDFB00C21EC6 /* ParseOperationable.swift in Sources */, 70CE0AAE28595FDE00DAEA86 /* ParseHookRequestable+combine.swift in Sources */, F97B45EB24D9C6F200F4A88B /* ParseGeoPoint.swift in Sources */, F97B460324D9C6F200F4A88B /* NoBody.swift in Sources */, @@ -3166,13 +3197,14 @@ F97B45F724D9C6F200F4A88B /* ParseError.swift in Sources */, 7045769E26BD934000F86F71 /* ParseFile+async.swift in Sources */, F97B463424D9C74400F4A88B /* URLSession.swift in Sources */, - F97B464F24D9C78B00F4A88B /* Add.swift in Sources */, + F97B464F24D9C78B00F4A88B /* ParseOperationAdd.swift in Sources */, 70D41D8128B520E200613510 /* ParseKeychainAccessGroup.swift in Sources */, 70385E772858E1000084D306 /* ParseHookFunctionable.swift in Sources */, 703B095426BF47FD005A112F /* ParseTwitter+async.swift in Sources */, 7051E2E32986F10D00ABFC7E /* SocketTasks.swift in Sources */, 70CE0ABD285F8FF900DAEA86 /* ParseTypeable.swift in Sources */, 70BC9891252A5B5C00FF3074 /* Objectable.swift in Sources */, + 916E208029D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift in Sources */, F97B45FF24D9C6F200F4A88B /* ParseFile.swift in Sources */, F97B45EF24D9C6F200F4A88B /* BaseParseUser.swift in Sources */, 706436A527341F6E007C6461 /* Encodable.swift in Sources */, @@ -3187,7 +3219,7 @@ 703B094A26BF47D0005A112F /* ParseLDAP+async.swift in Sources */, F97B45CF24D9C6F200F4A88B /* ParseCoding.swift in Sources */, 70CE0AA928595FCE00DAEA86 /* ParseHookRequestable+async.swift in Sources */, - F97B465724D9C78C00F4A88B /* Remove.swift in Sources */, + F97B465724D9C78C00F4A88B /* ParseOperationRemove.swift in Sources */, F97B45FB24D9C6F200F4A88B /* ParseACL.swift in Sources */, 7016ED6525C4C46B00038648 /* ParseObject+combine.swift in Sources */, 705025F12851542D008D6624 /* ParsePushFirebasePayloadable.swift in Sources */, @@ -3469,7 +3501,7 @@ 70CE0AC9285FD5A800DAEA86 /* ParseHookFunctionable+combine.swift in Sources */, 91F346BC269B766D005727B6 /* CloudViewModel.swift in Sources */, 708EF0C528D5FDF10052EF35 /* API+NonParseBodyCommand+async.swift in Sources */, - 709A148F2839A1DB00BF85E5 /* Operation.swift in Sources */, + 709A148F2839A1DB00BF85E5 /* ParseOperationCommand.swift in Sources */, 70CE0AD3285FD5D700DAEA86 /* ParseHookTriggerable+combine.swift in Sources */, 709A14A8283AAF4C00BF85E5 /* ParseSchema+combine.swift in Sources */, F97B45E924D9C6F200F4A88B /* Query.swift in Sources */, @@ -3509,7 +3541,7 @@ 7030E09329BBBFFA0021970D /* ParseConfigCodable+combine.swift in Sources */, 7085DD9726CBF3A70033B977 /* Documentation.docc in Sources */, 7C4C093D285E9A3700F202C6 /* ParseInstagram+combine.swift in Sources */, - F97B465D24D9C78C00F4A88B /* Increment.swift in Sources */, + F97B465D24D9C78C00F4A88B /* ParseOperationIncrement.swift in Sources */, 700395A625A119430052CB31 /* Operations.swift in Sources */, 91BB8FD22690BA70005A6BA5 /* QueryObservable.swift in Sources */, 705025E928514F36008D6624 /* ParsePushPayloadAny.swift in Sources */, @@ -3535,10 +3567,11 @@ 7044C1A225C4FA870011F6E7 /* ParseOperation+combine.swift in Sources */, 7030E08129BB8CDC0021970D /* ParseConfigCodable.swift in Sources */, 70212D162854C82B00386163 /* ParsePushFirebaseNotification.swift in Sources */, - F97B465124D9C78C00F4A88B /* Add.swift in Sources */, + 916E206E29D8C3E600C21EC6 /* ParseOperationBatch.swift in Sources */, + F97B465124D9C78C00F4A88B /* ParseOperationAdd.swift in Sources */, 7044C1B025C4FC080011F6E7 /* Query+combine.swift in Sources */, F97B461124D9C6F200F4A88B /* ParseObject.swift in Sources */, - 70C550A325B4A9F600B5DBC2 /* RemoveRelation.swift in Sources */, + 70C550A325B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift in Sources */, F97B460D24D9C6F200F4A88B /* Fetchable.swift in Sources */, 705025C0284C610C008D6624 /* ParsePush.swift in Sources */, F97B45ED24D9C6F200F4A88B /* ParseGeoPoint.swift in Sources */, @@ -3551,6 +3584,7 @@ 70B4E0BF2762F1D5004C9757 /* QueryConstraint.swift in Sources */, 7C55F9F42860CEEF002A352D /* ParseSpotify+combine.swift in Sources */, 704C886F28BE69A8008E6B01 /* ParseConfiguration.swift in Sources */, + 916E207329D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */, 89899D282603CF35002E2043 /* ParseTwitter.swift in Sources */, 70C167B727304F09009F4E30 /* Pointer+async.swift in Sources */, 705025B128456106008D6624 /* ParsePushStatusable.swift in Sources */, @@ -3583,7 +3617,7 @@ F97B466724D9C88600F4A88B /* SecureStorable.swift in Sources */, 703B093826BF43D9005A112F /* ParseAnonymous+async.swift in Sources */, 705D950B25BE4C08003EF6F8 /* SubscriptionCallback.swift in Sources */, - 70C5509525B4A99100B5DBC2 /* AddRelation.swift in Sources */, + 70C5509525B4A99100B5DBC2 /* ParseOperationAddRelation.swift in Sources */, 708D035525215F9B00646C70 /* Deletable.swift in Sources */, 70110D55250680140091CC1D /* ParseConstants.swift in Sources */, 7004C22325B63C7A005E0AD9 /* ParseRelation.swift in Sources */, @@ -3592,8 +3626,9 @@ 703B091426BD992E005A112F /* ParseOperation+async.swift in Sources */, 91F346C1269B77B5005727B6 /* CloudObservable.swift in Sources */, 70BDA2B6250536FF00FC2237 /* ParseInstallation.swift in Sources */, - F97B465924D9C78C00F4A88B /* Remove.swift in Sources */, + F97B465924D9C78C00F4A88B /* ParseOperationRemove.swift in Sources */, 70385E832858EAA90084D306 /* ParseHookFunctionRequest.swift in Sources */, + 916E207829D8CDFB00C21EC6 /* ParseOperationable.swift in Sources */, 70CE0AB028595FDE00DAEA86 /* ParseHookRequestable+combine.swift in Sources */, 70110D5A2506CE890091CC1D /* BaseParseInstallation.swift in Sources */, F97B45F924D9C6F200F4A88B /* ParseError.swift in Sources */, @@ -3620,8 +3655,9 @@ 7051E2E52986F10D00ABFC7E /* SocketTasks.swift in Sources */, 70CE0ABF285F8FF900DAEA86 /* ParseTypeable.swift in Sources */, 70BC9893252A5B5C00FF3074 /* Objectable.swift in Sources */, - F97B465524D9C78C00F4A88B /* AddUnique.swift in Sources */, - F97B464D24D9C78B00F4A88B /* Delete.swift in Sources */, + 916E208229D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift in Sources */, + F97B465524D9C78C00F4A88B /* ParseOperationAddUnique.swift in Sources */, + F97B464D24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */, 706436A727341F6E007C6461 /* Encodable.swift in Sources */, F97B461524D9C6F200F4A88B /* Savable.swift in Sources */, 70CE0A9728590A0A00DAEA86 /* ParseHookResponse.swift in Sources */, @@ -3667,7 +3703,7 @@ 70CE0AC8285FD5A800DAEA86 /* ParseHookFunctionable+combine.swift in Sources */, 91F346BB269B766D005727B6 /* CloudViewModel.swift in Sources */, 708EF0C428D5FDF10052EF35 /* API+NonParseBodyCommand+async.swift in Sources */, - 709A148E2839A1DB00BF85E5 /* Operation.swift in Sources */, + 709A148E2839A1DB00BF85E5 /* ParseOperationCommand.swift in Sources */, 70CE0AD2285FD5D700DAEA86 /* ParseHookTriggerable+combine.swift in Sources */, 709A14A7283AAF4C00BF85E5 /* ParseSchema+combine.swift in Sources */, F97B45E824D9C6F200F4A88B /* Query.swift in Sources */, @@ -3707,7 +3743,7 @@ 7030E09229BBBFFA0021970D /* ParseConfigCodable+combine.swift in Sources */, 7085DD9626CBF3A70033B977 /* Documentation.docc in Sources */, 7C4C093C285E9A3700F202C6 /* ParseInstagram+combine.swift in Sources */, - F97B465C24D9C78C00F4A88B /* Increment.swift in Sources */, + F97B465C24D9C78C00F4A88B /* ParseOperationIncrement.swift in Sources */, 700395A525A119430052CB31 /* Operations.swift in Sources */, 91BB8FD12690BA70005A6BA5 /* QueryObservable.swift in Sources */, 705025E828514F36008D6624 /* ParsePushPayloadAny.swift in Sources */, @@ -3733,10 +3769,11 @@ 7044C1A125C4FA870011F6E7 /* ParseOperation+combine.swift in Sources */, 7030E08029BB8CDC0021970D /* ParseConfigCodable.swift in Sources */, 70212D152854C82B00386163 /* ParsePushFirebaseNotification.swift in Sources */, - F97B465024D9C78B00F4A88B /* Add.swift in Sources */, + 916E206D29D8C3E600C21EC6 /* ParseOperationBatch.swift in Sources */, + F97B465024D9C78B00F4A88B /* ParseOperationAdd.swift in Sources */, 7044C1AF25C4FC080011F6E7 /* Query+combine.swift in Sources */, F97B461024D9C6F200F4A88B /* ParseObject.swift in Sources */, - 70C550A225B4A9F600B5DBC2 /* RemoveRelation.swift in Sources */, + 70C550A225B4A9F600B5DBC2 /* ParseOperationRemoveRelation.swift in Sources */, F97B460C24D9C6F200F4A88B /* Fetchable.swift in Sources */, 705025BF284C610C008D6624 /* ParsePush.swift in Sources */, F97B45EC24D9C6F200F4A88B /* ParseGeoPoint.swift in Sources */, @@ -3749,6 +3786,7 @@ 70B4E0BE2762F1D5004C9757 /* QueryConstraint.swift in Sources */, 7C55F9F32860CEEF002A352D /* ParseSpotify+combine.swift in Sources */, 704C886E28BE69A8008E6B01 /* ParseConfiguration.swift in Sources */, + 916E207229D8C83100C21EC6 /* ParseRelationOperationable.swift in Sources */, 89899D322603CF35002E2043 /* ParseTwitter.swift in Sources */, 70C167B627304F09009F4E30 /* Pointer+async.swift in Sources */, 705025B028456106008D6624 /* ParsePushStatusable.swift in Sources */, @@ -3781,7 +3819,7 @@ F97B466624D9C88600F4A88B /* SecureStorable.swift in Sources */, 703B093726BF43D9005A112F /* ParseAnonymous+async.swift in Sources */, 705D950A25BE4C08003EF6F8 /* SubscriptionCallback.swift in Sources */, - 70C5509425B4A99100B5DBC2 /* AddRelation.swift in Sources */, + 70C5509425B4A99100B5DBC2 /* ParseOperationAddRelation.swift in Sources */, 708D035425215F9B00646C70 /* Deletable.swift in Sources */, 70110D54250680140091CC1D /* ParseConstants.swift in Sources */, 7004C22225B63C7A005E0AD9 /* ParseRelation.swift in Sources */, @@ -3790,8 +3828,9 @@ 703B091326BD992E005A112F /* ParseOperation+async.swift in Sources */, 91F346C0269B77B5005727B6 /* CloudObservable.swift in Sources */, 70BDA2B5250536FF00FC2237 /* ParseInstallation.swift in Sources */, - F97B465824D9C78C00F4A88B /* Remove.swift in Sources */, + F97B465824D9C78C00F4A88B /* ParseOperationRemove.swift in Sources */, 70385E822858EAA90084D306 /* ParseHookFunctionRequest.swift in Sources */, + 916E207729D8CDFB00C21EC6 /* ParseOperationable.swift in Sources */, 70CE0AAF28595FDE00DAEA86 /* ParseHookRequestable+combine.swift in Sources */, 70110D592506CE890091CC1D /* BaseParseInstallation.swift in Sources */, F97B45F824D9C6F200F4A88B /* ParseError.swift in Sources */, @@ -3818,8 +3857,9 @@ 7051E2E42986F10D00ABFC7E /* SocketTasks.swift in Sources */, 70CE0ABE285F8FF900DAEA86 /* ParseTypeable.swift in Sources */, 70BC9892252A5B5C00FF3074 /* Objectable.swift in Sources */, - F97B465424D9C78C00F4A88B /* AddUnique.swift in Sources */, - F97B464C24D9C78B00F4A88B /* Delete.swift in Sources */, + 916E208129D8EB6800C21EC6 /* ParseOperationIncrementDouble.swift in Sources */, + F97B465424D9C78C00F4A88B /* ParseOperationAddUnique.swift in Sources */, + F97B464C24D9C78B00F4A88B /* ParseOperationDelete.swift in Sources */, 706436A627341F6E007C6461 /* Encodable.swift in Sources */, F97B461424D9C6F200F4A88B /* Savable.swift in Sources */, 70CE0A9628590A0A00DAEA86 /* ParseHookResponse.swift in Sources */, diff --git a/README.md b/README.md index 0859313dc..61179c5e6 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ import PackageDescription let package = Package( name: "YOUR_PROJECT_NAME", dependencies: [ - .package(url: "https://github.com/netreconlab/Parse-Swift", .upToNextMajor(from: "5.3.3")), + .package(url: "https://github.com/netreconlab/Parse-Swift", .upToNextMajor(from: "5.4.0")), ] ) ``` diff --git a/Sources/ParseSwift/API/API+Command.swift b/Sources/ParseSwift/API/API+Command.swift index 1a55abb72..434955e9c 100644 --- a/Sources/ParseSwift/API/API+Command.swift +++ b/Sources/ParseSwift/API/API+Command.swift @@ -3,7 +3,7 @@ // ParseSwift // // Created by Florent Vilmart on 17-09-24. -// Copyright © 2020 Network Reconnaissance Lab. All rights reserved. +// Copyright © 2020 Parse. All rights reserved. // import Foundation diff --git a/Sources/ParseSwift/API/BatchUtils.swift b/Sources/ParseSwift/API/BatchUtils.swift index 4e0864ed4..5386b94e4 100644 --- a/Sources/ParseSwift/API/BatchUtils.swift +++ b/Sources/ParseSwift/API/BatchUtils.swift @@ -3,7 +3,7 @@ // ParseSwift // // Created by Florent Vilmart on 17-08-19. -// Copyright © 2020 Network Reconnaissance Lab. All rights reserved. +// Copyright © 2020 Parse. All rights reserved. // import Foundation diff --git a/Sources/ParseSwift/API/Responses.swift b/Sources/ParseSwift/API/Responses.swift index 77938f144..9ffee9d06 100644 --- a/Sources/ParseSwift/API/Responses.swift +++ b/Sources/ParseSwift/API/Responses.swift @@ -3,7 +3,7 @@ // ParseSwift // // Created by Florent Vilmart on 17-08-20. -// Copyright © 2020 Network Reconnaissance Lab. All rights reserved. +// Copyright © 2020 Parse. All rights reserved. // import Foundation diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple.swift index 74aab939c..ff59c6584 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple.swift @@ -53,7 +53,7 @@ public struct ParseApple: ParseAuthentication { "apple" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook.swift index 17219e9e9..7127bf9c3 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook.swift @@ -71,7 +71,7 @@ public struct ParseFacebook: ParseAuthentication { "facebook" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseGithub/ParseGitHub.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseGithub/ParseGitHub.swift index f31f4925c..f170ee2dc 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseGithub/ParseGitHub.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseGithub/ParseGitHub.swift @@ -52,7 +52,7 @@ public struct ParseGitHub: ParseAuthentication { "github" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseGoogle/ParseGoogle.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseGoogle/ParseGoogle.swift index 55345ca4e..1bae3a817 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseGoogle/ParseGoogle.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseGoogle/ParseGoogle.swift @@ -61,7 +61,7 @@ public struct ParseGoogle: ParseAuthentication { "google" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseInstagram/ParseInstagram.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseInstagram/ParseInstagram.swift index 1170d3d42..eb8efa130 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseInstagram/ParseInstagram.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseInstagram/ParseInstagram.swift @@ -60,7 +60,7 @@ public struct ParseInstagram: ParseAuthentication "instagram" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP.swift index 4b4eeab17..039365172 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP.swift @@ -47,7 +47,7 @@ public struct ParseLDAP: ParseAuthentication { "ldap" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseLinkedIn/ParseLinkedIn.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseLinkedIn/ParseLinkedIn.swift index 6fbbadc7b..e4cc4d70e 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseLinkedIn/ParseLinkedIn.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseLinkedIn/ParseLinkedIn.swift @@ -56,7 +56,7 @@ public struct ParseLinkedIn: ParseAuthentication { "linkedin" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseSpotify/ParseSpotify.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseSpotify/ParseSpotify.swift index 4cd6df5ed..e5b97bb89 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseSpotify/ParseSpotify.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseSpotify/ParseSpotify.swift @@ -67,7 +67,7 @@ public struct ParseSpotify: ParseAuthentication { "spotify" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter.swift index 500adc9be..e21fbcbcb 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter.swift @@ -71,7 +71,7 @@ public struct ParseTwitter: ParseAuthentication { "twitter" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Authentication/Internal/ParseAnonymous.swift b/Sources/ParseSwift/Authentication/Internal/ParseAnonymous.swift index f05c66fdd..bc70e76e5 100644 --- a/Sources/ParseSwift/Authentication/Internal/ParseAnonymous.swift +++ b/Sources/ParseSwift/Authentication/Internal/ParseAnonymous.swift @@ -40,7 +40,7 @@ public struct ParseAnonymous: ParseAuthentication "anonymous" } - public init() { } + public init() {} } // MARK: Login diff --git a/Sources/ParseSwift/Operations/Add.swift b/Sources/ParseSwift/Operations/Add.swift deleted file mode 100644 index ebd08c536..000000000 --- a/Sources/ParseSwift/Operations/Add.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// Add.swift -// Parse -// -// Created by Florent Vilmart on 17-07-24. -// Copyright © 2017 Parse. All rights reserved. -// - -import Foundation - -internal struct Add: Encodable where T: Encodable { - let __op: Operation = .add // swiftlint:disable:this identifier_name - let objects: [T] -} diff --git a/Sources/ParseSwift/Operations/AddRelation.swift b/Sources/ParseSwift/Operations/AddRelation.swift deleted file mode 100644 index e30c79cb0..000000000 --- a/Sources/ParseSwift/Operations/AddRelation.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// AddRelation.swift -// ParseSwift -// -// Created by Corey Baker on 1/17/21. -// Copyright © 2021 Network Reconnaissance Lab. All rights reserved. -// - -import Foundation - -internal struct AddRelation: Encodable where T: ParseObject { - let __op: Operation = .addRelation // swiftlint:disable:this identifier_name - let objects: [Pointer] - - init(objects: [T]) throws { - self.objects = try objects.compactMap { try $0.toPointer() } - } -} diff --git a/Sources/ParseSwift/Operations/AddUnique.swift b/Sources/ParseSwift/Operations/AddUnique.swift deleted file mode 100644 index 1e2f40d71..000000000 --- a/Sources/ParseSwift/Operations/AddUnique.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// AddUnique.swift -// Parse -// -// Created by Florent Vilmart on 17-07-24. -// Copyright © 2017 Parse. All rights reserved. -// - -import Foundation - -internal struct AddUnique: Encodable where T: Encodable { - let __op: Operation = .addUnique // swiftlint:disable:this identifier_name - let objects: [T] -} diff --git a/Sources/ParseSwift/Operations/Delete.swift b/Sources/ParseSwift/Operations/Delete.swift deleted file mode 100644 index 020f72afd..000000000 --- a/Sources/ParseSwift/Operations/Delete.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// Delete.swift -// Parse -// -// Created by Florent Vilmart on 17-07-24. -// Copyright © 2017 Parse. All rights reserved. -// - -import Foundation - -internal struct Delete: Encodable { - let __op: Operation = .delete // swiftlint:disable:this identifier_name -} diff --git a/Sources/ParseSwift/Operations/Increment.swift b/Sources/ParseSwift/Operations/Increment.swift deleted file mode 100644 index b52fc4dc6..000000000 --- a/Sources/ParseSwift/Operations/Increment.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// IncrementOperation.swift -// Parse -// -// Created by Florent Vilmart on 17-07-24. -// Copyright © 2017 Parse. All rights reserved. -// - -import Foundation - -internal struct Increment: Encodable { - let __op: Operation = .increment // swiftlint:disable:this identifier_name - let amount: Int -} diff --git a/Sources/ParseSwift/Operations/Operation.swift b/Sources/ParseSwift/Operations/Operation.swift deleted file mode 100644 index 6d947c131..000000000 --- a/Sources/ParseSwift/Operations/Operation.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// Operation.swift -// ParseSwift -// -// Created by Corey Baker on 5/21/22. -// Copyright © 2022 Network Reconnaissance Lab. All rights reserved. -// - -import Foundation - -enum Operation: String, Codable { - case add = "Add" - case addRelation = "AddRelation" - case addUnique = "AddUnique" - case delete = "Delete" - case increment = "Increment" - case remove = "Remove" - case removeRelation = "RemoveRelation" -} diff --git a/Sources/ParseSwift/Operations/Remove.swift b/Sources/ParseSwift/Operations/Remove.swift deleted file mode 100644 index 3455d7a01..000000000 --- a/Sources/ParseSwift/Operations/Remove.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// Remove.swift -// Parse -// -// Created by Florent Vilmart on 17-07-24. -// Copyright © 2017 Parse. All rights reserved. -// - -import Foundation - -internal struct Remove: Encodable where T: Encodable { - let __op: Operation = .remove // swiftlint:disable:this identifier_name - let objects: [T] -} diff --git a/Sources/ParseSwift/Operations/RemoveRelation.swift b/Sources/ParseSwift/Operations/RemoveRelation.swift deleted file mode 100644 index 554f8a460..000000000 --- a/Sources/ParseSwift/Operations/RemoveRelation.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// RemoveRelation.swift -// ParseSwift -// -// Created by Corey Baker on 1/17/21. -// Copyright © 2021 Network Reconnaissance Lab. All rights reserved. -// - -import Foundation - -internal struct RemoveRelation: Encodable where T: ParseObject { - let __op: Operation = .removeRelation // swiftlint:disable:this identifier_name - let objects: [Pointer] - - init(objects: [T]) throws { - self.objects = try objects.compactMap { try $0.toPointer() } - } -} diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index 72ebdf524..75e5f9fb5 100644 --- a/Sources/ParseSwift/ParseConstants.swift +++ b/Sources/ParseSwift/ParseConstants.swift @@ -10,7 +10,7 @@ import Foundation enum ParseConstants { static let sdk = "swift" - static let version = "5.3.3" + static let version = "5.4.0" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/" diff --git a/Sources/ParseSwift/Protocols/ParseHookFunctionable.swift b/Sources/ParseSwift/Protocols/ParseHookFunctionable.swift index 55592fd95..0feba9201 100644 --- a/Sources/ParseSwift/Protocols/ParseHookFunctionable.swift +++ b/Sources/ParseSwift/Protocols/ParseHookFunctionable.swift @@ -263,11 +263,11 @@ extension ParseHookFunctionable { } } - func deleteCommand() throws -> API.NonParseBodyCommand { + func deleteCommand() throws -> API.NonParseBodyCommand { let request = try FunctionRequest(hookFunction: self) return API.NonParseBodyCommand(method: .PUT, path: .hookFunction(request: request), - body: Delete()) { (data) -> NoBody in + body: ParseOperationDelete()) { (data) -> NoBody in try ParseCoding.jsonDecoder().decode(NoBody.self, from: data) } } diff --git a/Sources/ParseSwift/Protocols/ParseHookTriggerable.swift b/Sources/ParseSwift/Protocols/ParseHookTriggerable.swift index 4fab249e0..8e8dfb7e4 100644 --- a/Sources/ParseSwift/Protocols/ParseHookTriggerable.swift +++ b/Sources/ParseSwift/Protocols/ParseHookTriggerable.swift @@ -299,11 +299,11 @@ extension ParseHookTriggerable { } } - func deleteCommand() throws -> API.NonParseBodyCommand { + func deleteCommand() throws -> API.NonParseBodyCommand { let request = try TriggerRequest(trigger: self) return API.NonParseBodyCommand(method: .PUT, path: .hookTrigger(request: request), - body: Delete()) { (data) -> NoBody in + body: ParseOperationDelete()) { (data) -> NoBody in try ParseCoding.jsonDecoder().decode(NoBody.self, from: data) } } diff --git a/Sources/ParseSwift/Protocols/ParseOperationable.swift b/Sources/ParseSwift/Protocols/ParseOperationable.swift new file mode 100644 index 000000000..eacc9ab3b --- /dev/null +++ b/Sources/ParseSwift/Protocols/ParseOperationable.swift @@ -0,0 +1,36 @@ +// +// ParseOperationable.swift +// ParseSwift +// +// Created by Corey Baker on 4/1/23. +// Copyright © 2023 Network Reconnaissance Lab. All rights reserved. +// + +import Foundation + +/// A protocol that allows a type to be a Parse operation. +public protocol ParseOperationable: Codable, + CustomDebugStringConvertible, + CustomStringConvertible { + /// The operation command for this operation. + var __op: ParseOperationCommand { get } // swiftlint:disable:this identifier_name +} + +// MARK: CustomDebugStringConvertible +public extension ParseOperationable { + var debugDescription: String { + guard let descriptionData = try? ParseCoding.jsonEncoder().encode(self), + let descriptionString = String(data: descriptionData, encoding: .utf8) else { + return "()" + } + + return "\(descriptionString)" + } +} + +// MARK: CustomStringConvertible +public extension ParseOperationable { + var description: String { + debugDescription + } +} diff --git a/Sources/ParseSwift/Protocols/ParseRelationOperationable.swift b/Sources/ParseSwift/Protocols/ParseRelationOperationable.swift new file mode 100644 index 000000000..2cbfc6f18 --- /dev/null +++ b/Sources/ParseSwift/Protocols/ParseRelationOperationable.swift @@ -0,0 +1,15 @@ +// +// ParseRelationOperationable.swift +// ParseSwift +// +// Created by Corey Baker on 4/1/23. +// Copyright © 2023 Network Reconnaissance Lab. All rights reserved. +// + +import Foundation + +public protocol ParseRelationOperationable: ParseOperationable { + associatedtype Object: ParseObject + var __op: ParseOperationCommand { get set } // swiftlint:disable:this identifier_name + var objects: [Pointer] { get set } +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationAdd.swift b/Sources/ParseSwift/Types/Operations/ParseOperationAdd.swift new file mode 100644 index 000000000..95273bc8f --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationAdd.swift @@ -0,0 +1,26 @@ +// +// ParseOperationAdd.swift +// Parse +// +// Created by Florent Vilmart on 17-07-24. +// Copyright © 2017 Parse. All rights reserved. +// + +import Foundation + +/** + An operation that adds new objects to an array field. + */ +public struct ParseOperationAdd: ParseOperationable where T: Codable { + public var __op: ParseOperationCommand = .add // swiftlint:disable:this identifier_name + /// The array of objects related to the operation. + public var objects: [T] + + /** + Create an instance with an array of objects. + - parameter objects: The array of objects to add + */ + public init(objects: [T]) { + self.objects = objects + } +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationAddRelation.swift b/Sources/ParseSwift/Types/Operations/ParseOperationAddRelation.swift new file mode 100644 index 000000000..df54c347c --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationAddRelation.swift @@ -0,0 +1,26 @@ +// +// ParseOperationAddRelation.swift +// ParseSwift +// +// Created by Corey Baker on 1/17/21. +// Copyright © 2021 Network Reconnaissance Lab. All rights reserved. +// + +import Foundation + +/** + An operation that adds new relations to an array field. + */ +public struct ParseOperationAddRelation: ParseRelationOperationable where T: ParseObject { + public var __op: ParseOperationCommand = .addRelation // swiftlint:disable:this identifier_name + /// The array of `ParseObject` pointers related to the operation. + public var objects: [Pointer] + + /** + Create an instance with an array of `ParseObject`'s. + - parameter objects: The array of `ParseObject`'s to add. + */ + public init(objects: [T]) throws { + self.objects = try objects.compactMap { try $0.toPointer() } + } +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationAddUnique.swift b/Sources/ParseSwift/Types/Operations/ParseOperationAddUnique.swift new file mode 100644 index 000000000..9f4ba5fce --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationAddUnique.swift @@ -0,0 +1,26 @@ +// +// ParseOperationAddUnique.swift +// Parse +// +// Created by Florent Vilmart on 17-07-24. +// Copyright © 2017 Parse. All rights reserved. +// + +import Foundation + +/** + An operation that adds unique objects to an array field. + */ +public struct ParseOperationAddUnique: ParseOperationable where T: Codable & Hashable { + public var __op: ParseOperationCommand = .addUnique // swiftlint:disable:this identifier_name + /// The array of objects related to the operation. + public var objects: Set + + /** + Create an instance with an array of `ParseObject`'s. + - parameter objects: The array of objects to add. + */ + public init(objects: [T]) { + self.objects = Set(objects) + } +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationBatch.swift b/Sources/ParseSwift/Types/Operations/ParseOperationBatch.swift new file mode 100644 index 000000000..89e2707c0 --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationBatch.swift @@ -0,0 +1,51 @@ +// +// ParseOperationBatch.swift +// ParseSwift +// +// Created by Corey Baker on 4/1/23. +// Copyright © 2023 Network Reconnaissance Lab. All rights reserved. +// + +import Foundation + +/** + An operation that batches multiple operations on a field. + - warning: The developer must ensure that the respective Parse Server supports the + set of batch operations and that the operations are compatable with the field type. + - note: It is known that `ParseOperationAddRelation` and + `ParseOperationRemoveRelation` are the only two types of operations that + can be batched together on Parse Server <= 6.0.0. + */ +public struct ParseOperationBatch: ParseOperationable { + public var __op: ParseOperationCommand = .batch // swiftlint:disable:this identifier_name + internal var operations: [AnyCodable] + + /** + Create an instance with an array of `ParseOperationable` operations of the same type. + - parameter operations: The array of `ParseOperationable` operations to batch. + - note: To append `ParseOperationable` operations of a different type, use `appendOperations()` + after creating an instance of `ParseOperationBatch`. + */ + public init(operations: [T]) where T: ParseOperationable { + self.operations = operations.map { AnyCodable($0) } + } + + /** + Append an array of `ParseOperationable` operations. + - parameter operations: The array of `ParseOperationable` operations to append. + - returns: An instance of `ParseOperationBatch` for easy chaining. + - note: The respective type of `ParseOperationable` has to be consistant per unique call + of `appendOperations()` (basically the array cannot be mixed). To append + `ParseOperationable` operations of a different type, call `appendOperations()` for each type. + */ + public func appendOperations(operations: [T]) -> Self where T: ParseOperationable { + var mutableBatch = self + mutableBatch.operations.append(contentsOf: operations.map { AnyCodable($0) }) + return mutableBatch + } + + enum CodingKeys: String, CodingKey { + case __op + case operations = "ops" + } +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationCommand.swift b/Sources/ParseSwift/Types/Operations/ParseOperationCommand.swift new file mode 100644 index 000000000..86026a60a --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationCommand.swift @@ -0,0 +1,29 @@ +// +// ParseOperationCommand.swift +// ParseSwift +// +// Created by Corey Baker on 5/21/22. +// Copyright © 2022 Network Reconnaissance Lab. All rights reserved. +// + +import Foundation + +/// Represents all supported Parse operation commands. +public enum ParseOperationCommand: String, Codable { + /// The add command. + case add = "Add" + /// The add relation command. + case addRelation = "AddRelation" + /// The add unique command. + case addUnique = "AddUnique" + /// The batch command. + case batch = "Batch" + /// The delete command. + case delete = "Delete" + /// The increment command. + case increment = "Increment" + /// The remove command. + case remove = "Remove" + /// The remove relation command. + case removeRelation = "RemoveRelation" +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationDelete.swift b/Sources/ParseSwift/Types/Operations/ParseOperationDelete.swift new file mode 100644 index 000000000..216b7f365 --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationDelete.swift @@ -0,0 +1,19 @@ +// +// ParseOperationDelete.swift +// Parse +// +// Created by Florent Vilmart on 17-07-24. +// Copyright © 2017 Parse. All rights reserved. +// + +import Foundation + +/** + An operation that deletes a field. + */ +public struct ParseOperationDelete: ParseOperationable { + public var __op: ParseOperationCommand = .delete // swiftlint:disable:this identifier_name + + /// Create an instance. + public init() {} +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationIncrement.swift b/Sources/ParseSwift/Types/Operations/ParseOperationIncrement.swift new file mode 100644 index 000000000..25fa76574 --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationIncrement.swift @@ -0,0 +1,27 @@ +// +// ParseOperationIncrement.swift +// Parse +// +// Created by Florent Vilmart on 17-07-24. +// Copyright © 2017 Parse. All rights reserved. +// + +import Foundation + +/** + An operation that increments a field. + - note: A field can be incremented/decremented by a positive/negative value. + */ +public struct ParseOperationIncrement: ParseOperationable { + public var __op: ParseOperationCommand = .increment // swiftlint:disable:this identifier_name + /// The amount to increment/decrement by. + var amount: Int + + /** + Create an instance to increment/decrement a field. + - parameter amount: The amount to increment/decrement by. + */ + public init(amount: Int) { + self.amount = amount + } +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationIncrementDouble.swift b/Sources/ParseSwift/Types/Operations/ParseOperationIncrementDouble.swift new file mode 100644 index 000000000..a8ee5f095 --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationIncrementDouble.swift @@ -0,0 +1,27 @@ +// +// ParseOperationIncrementDouble.swift +// ParseSwift +// +// Created by Corey Baker on 4/1/23. +// Copyright © 2023 Network Reconnaissance Lab. All rights reserved. +// + +import Foundation + +/** + An operation that increments a field. + - note: A field can be incremented/decremented by a positive/negative value. + */ +public struct ParseOperationIncrementDouble: ParseOperationable { + public var __op: ParseOperationCommand = .increment // swiftlint:disable:this identifier_name + /// The amount to increment/decrement by. + var amount: Double + + /** + Create an instance to increment/decrement a field.. + - parameter amount: The amount to increment/decrement by. + */ + public init(amount: Double) { + self.amount = amount + } +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationRemove.swift b/Sources/ParseSwift/Types/Operations/ParseOperationRemove.swift new file mode 100644 index 000000000..50ea02458 --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationRemove.swift @@ -0,0 +1,26 @@ +// +// ParseOperationRemove.swift +// Parse +// +// Created by Florent Vilmart on 17-07-24. +// Copyright © 2017 Parse. All rights reserved. +// + +import Foundation + +/** + An operation that removes a set of objects from a field. + */ +public struct ParseOperationRemove: ParseOperationable where T: Codable { + public var __op: ParseOperationCommand = .remove // swiftlint:disable:this identifier_name + /// The array of objects related to the operation. + public let objects: [T] + + /** + Create an instance with an array of objects. + - parameter objects: The array of objects to remove. + */ + public init(objects: [T]) { + self.objects = objects + } +} diff --git a/Sources/ParseSwift/Types/Operations/ParseOperationRemoveRelation.swift b/Sources/ParseSwift/Types/Operations/ParseOperationRemoveRelation.swift new file mode 100644 index 000000000..6915f4649 --- /dev/null +++ b/Sources/ParseSwift/Types/Operations/ParseOperationRemoveRelation.swift @@ -0,0 +1,26 @@ +// +// ParseOperationRemoveRelation.swift +// ParseSwift +// +// Created by Corey Baker on 1/17/21. +// Copyright © 2021 Network Reconnaissance Lab. All rights reserved. +// + +import Foundation + +/** + An operation that removes a set of relations on an array field. + */ +public struct ParseOperationRemoveRelation: ParseRelationOperationable where T: ParseObject { + public var __op: ParseOperationCommand = .removeRelation // swiftlint:disable:this identifier_name + /// The array of `ParseObject` pointers related to the operation. + public var objects: [Pointer] + + /** + Create an instance with an array of `ParseObject`'s. + - parameter objects: The array of `ParseObject`'s to remove. + */ + init(objects: [T]) throws { + self.objects = try objects.compactMap { try $0.toPointer() } + } +} diff --git a/Sources/ParseSwift/Types/ParseACL.swift b/Sources/ParseSwift/Types/ParseACL.swift index 3cdce95d4..57b8e1be2 100644 --- a/Sources/ParseSwift/Types/ParseACL.swift +++ b/Sources/ParseSwift/Types/ParseACL.swift @@ -45,7 +45,7 @@ public struct ParseACL: ParseTypeable, } /// The default initializer. - public init() { } + public init() {} static func getRoleAccessName(_ role: R) throws -> String where R: ParseRole { guard let name = role.name else { diff --git a/Sources/ParseSwift/Types/ParseCLP.swift b/Sources/ParseSwift/Types/ParseCLP.swift index 3d2441918..cb46ebb00 100644 --- a/Sources/ParseSwift/Types/ParseCLP.swift +++ b/Sources/ParseSwift/Types/ParseCLP.swift @@ -101,7 +101,7 @@ public struct ParseCLP: ParseTypeable { } /// Creates an empty instance of CLP. - public init() { } + public init() {} /** Creates an instance of CLP with particular access. diff --git a/Sources/ParseSwift/Types/ParseError.swift b/Sources/ParseSwift/Types/ParseError.swift index 50d29b31a..63ab04ea8 100644 --- a/Sources/ParseSwift/Types/ParseError.swift +++ b/Sources/ParseSwift/Types/ParseError.swift @@ -3,7 +3,7 @@ // ParseSwift // // Created by Florent Vilmart on 17-09-24. -// Copyright © 2020 Network Reconnaissance Lab. All rights reserved. +// Copyright © 2020 Parse. All rights reserved. // import Foundation diff --git a/Sources/ParseSwift/Types/ParseField.swift b/Sources/ParseSwift/Types/ParseField.swift index 8b31b1024..93f45c37a 100644 --- a/Sources/ParseSwift/Types/ParseField.swift +++ b/Sources/ParseSwift/Types/ParseField.swift @@ -10,7 +10,7 @@ import Foundation /// A type used to create internal fields for `ParseSchema`. public struct ParseField: ParseTypeable { - var __op: Operation? // swiftlint:disable:this identifier_name + var __op: ParseOperationCommand? // swiftlint:disable:this identifier_name var type: FieldType? var required: Bool? var defaultValue: AnyCodable? @@ -46,7 +46,7 @@ public struct ParseField: ParseTypeable { case acl = "ACL" } - init(operation: Operation) { + init(operation: ParseOperationCommand) { __op = operation } diff --git a/Sources/ParseSwift/Types/ParseOperation.swift b/Sources/ParseSwift/Types/ParseOperation.swift index f7f2c845a..77c45762a 100644 --- a/Sources/ParseSwift/Types/ParseOperation.swift +++ b/Sources/ParseSwift/Types/ParseOperation.swift @@ -16,10 +16,12 @@ import Foundation In most cases, you do not need to create an instance of `ParseOperation` directly as it can be indirectly created from any `ParseObject` by using the respective `operation` property. */ -public struct ParseOperation: Savable where T: ParseObject { +public struct ParseOperation: Savable, + CustomDebugStringConvertible, + CustomStringConvertible where T: ParseObject { var target: T - var operations = [String: Encodable]() + var operations = [String: Codable]() var keysToNull = Set() public init(target: T) { @@ -64,7 +66,7 @@ public struct ParseOperation: Savable where T: ParseObject { - Note: Set the value to "nil" if you want it to be "null" on the Parse Server. */ public func set(_ key: (String, WritableKeyPath), - to value: W?) -> Self where W: Encodable & Equatable { + to value: W?) -> Self where W: Codable & Equatable { var mutableOperation = self if value == nil && target[keyPath: key.1] != nil { mutableOperation.keysToNull.insert(key.0) @@ -85,7 +87,7 @@ public struct ParseOperation: Savable where T: ParseObject { - Note: Set the value to "nil" if you want it to be "null" on the Parse Server. */ public func forceSet(_ key: (String, WritableKeyPath), - value: W?) -> Self where W: Encodable { + value: W?) -> Self where W: Codable { forceSet(key, to: value) } @@ -98,7 +100,7 @@ public struct ParseOperation: Savable where T: ParseObject { - Note: Set the value to "nil" if you want it to be "null" on the Parse Server. */ public func forceSet(_ key: (String, WritableKeyPath), - to value: W?) -> Self where W: Encodable { + to value: W?) -> Self where W: Codable { var mutableOperation = self if value != nil { mutableOperation.operations[key.0] = value @@ -113,12 +115,27 @@ public struct ParseOperation: Savable where T: ParseObject { An operation that increases a numeric field's value by a given amount. - Parameters: - key: The key of the object. - - amount: How much to increment by. + - amount: How much to increment/decrement by. - returns: The updated operations. + - note: A field can be incremented/decremented by a positive/negative value. */ public func increment(_ key: String, by amount: Int) -> Self { var mutableOperation = self - mutableOperation.operations[key] = Increment(amount: amount) + mutableOperation.operations[key] = ParseOperationIncrement(amount: amount) + return mutableOperation + } + + /** + An operation that increases a numeric field's value by a given amount. + - Parameters: + - key: The key of the object. + - amount: How much to increment/decrement by. + - returns: The updated operations. + - note: A field can be incremented/decremented by a positive/negative value. + */ + public func increment(_ key: String, by amount: Double) -> Self { + var mutableOperation = self + mutableOperation.operations[key] = ParseOperationIncrementDouble(amount: amount) return mutableOperation } @@ -130,9 +147,9 @@ public struct ParseOperation: Savable where T: ParseObject { - objects: The field of objects. - returns: The updated operations. */ - public func addUnique(_ key: String, objects: [W]) -> Self where W: Encodable, W: Hashable { + public func addUnique(_ key: String, objects: [W]) -> Self where W: Codable, W: Hashable { var mutableOperation = self - mutableOperation.operations[key] = AddUnique(objects: objects) + mutableOperation.operations[key] = ParseOperationAddUnique(objects: objects) return mutableOperation } @@ -145,9 +162,9 @@ public struct ParseOperation: Savable where T: ParseObject { - returns: The updated operations. */ public func addUnique(_ key: (String, WritableKeyPath), - objects: [V]) -> Self where V: Encodable, V: Hashable { + objects: [V]) -> Self where V: Codable, V: Hashable { var mutableOperation = self - mutableOperation.operations[key.0] = AddUnique(objects: objects) + mutableOperation.operations[key.0] = ParseOperationAddUnique(objects: objects) var values = target[keyPath: key.1] ?? [] values.append(contentsOf: objects) mutableOperation.target[keyPath: key.1] = Array(Set(values)) @@ -161,9 +178,9 @@ public struct ParseOperation: Savable where T: ParseObject { - objects: The field of objects. - returns: The updated operations. */ - public func add(_ key: String, objects: [W]) -> Self where W: Encodable { + public func add(_ key: String, objects: [W]) -> Self where W: Codable { var mutableOperation = self - mutableOperation.operations[key] = Add(objects: objects) + mutableOperation.operations[key] = ParseOperationAdd(objects: objects) return mutableOperation } @@ -175,9 +192,9 @@ public struct ParseOperation: Savable where T: ParseObject { - returns: The updated operations. */ public func add(_ key: (String, WritableKeyPath), - objects: [V]) -> Self where V: Encodable { + objects: [V]) -> Self where V: Codable { var mutableOperation = self - mutableOperation.operations[key.0] = Add(objects: objects) + mutableOperation.operations[key.0] = ParseOperationAdd(objects: objects) var values = target[keyPath: key.1] ?? [] values.append(contentsOf: objects) mutableOperation.target[keyPath: key.1] = values @@ -193,7 +210,7 @@ public struct ParseOperation: Savable where T: ParseObject { */ public func addRelation(_ key: String, objects: [W]) throws -> Self where W: ParseObject { var mutableOperation = self - mutableOperation.operations[key] = try AddRelation(objects: objects) + mutableOperation.operations[key] = try ParseOperationAddRelation(objects: objects) return mutableOperation } @@ -207,7 +224,7 @@ public struct ParseOperation: Savable where T: ParseObject { public func addRelation(_ key: (String, WritableKeyPath), objects: [V]) throws -> Self where V: ParseObject { var mutableOperation = self - mutableOperation.operations[key.0] = try AddRelation(objects: objects) + mutableOperation.operations[key.0] = try ParseOperationAddRelation(objects: objects) var values = target[keyPath: key.1] ?? [] values.append(contentsOf: objects) mutableOperation.target[keyPath: key.1] = values @@ -222,9 +239,9 @@ public struct ParseOperation: Savable where T: ParseObject { - objects: The field of objects. - returns: The updated operations. */ - public func remove(_ key: String, objects: [W]) -> Self where W: Encodable { + public func remove(_ key: String, objects: [W]) -> Self where W: Codable { var mutableOperation = self - mutableOperation.operations[key] = Remove(objects: objects) + mutableOperation.operations[key] = ParseOperationRemove(objects: objects) return mutableOperation } @@ -237,9 +254,9 @@ public struct ParseOperation: Savable where T: ParseObject { - returns: The updated operations. */ public func remove(_ key: (String, WritableKeyPath), - objects: [V]) -> Self where V: Encodable, V: Hashable { + objects: [V]) -> Self where V: Codable, V: Hashable { var mutableOperation = self - mutableOperation.operations[key.0] = Remove(objects: objects) + mutableOperation.operations[key.0] = ParseOperationRemove(objects: objects) let values = target[keyPath: key.1] var set = Set(values ?? []) objects.forEach { @@ -259,7 +276,7 @@ public struct ParseOperation: Savable where T: ParseObject { */ public func removeRelation(_ key: String, objects: [W]) throws -> Self where W: ParseObject { var mutableOperation = self - mutableOperation.operations[key] = try RemoveRelation(objects: objects) + mutableOperation.operations[key] = try ParseOperationRemoveRelation(objects: objects) return mutableOperation } @@ -274,7 +291,7 @@ public struct ParseOperation: Savable where T: ParseObject { public func removeRelation(_ key: (String, WritableKeyPath), objects: [V]) throws -> Self where V: ParseObject { var mutableOperation = self - mutableOperation.operations[key.0] = try RemoveRelation(objects: objects) + mutableOperation.operations[key.0] = try ParseOperationRemoveRelation(objects: objects) let values = target[keyPath: key.1] var set = Set(values ?? []) objects.forEach { @@ -284,6 +301,24 @@ public struct ParseOperation: Savable where T: ParseObject { return mutableOperation } + /** + An operation that batches an array of operations on a particular field. + - Parameters: + - key: The key of the object. + - operations: The batch of operations to complete on the `key`. + - returns: The updated operations. + - warning: The developer must ensure that the respective Parse Server supports the + set of batch operations and that the operations are compatable with the field type. + - note: It is known that `ParseOperationAddRelation` and + `ParseOperationRemoveRelation` are the only two types of operations that + can be batched together on Parse Server <= 6.0.0. + */ + public func batch(_ key: String, operations batch: ParseOperationBatch) -> Self { + var mutableOperation = self + mutableOperation.operations[key] = batch + return mutableOperation + } + /** An operation where a field is deleted from the object. - parameter key: The key of the object. @@ -291,7 +326,7 @@ public struct ParseOperation: Savable where T: ParseObject { */ public func unset(_ key: String) -> Self { var mutableOperation = self - mutableOperation.operations[key] = Delete() + mutableOperation.operations[key] = ParseOperationDelete() return mutableOperation } @@ -301,9 +336,9 @@ public struct ParseOperation: Savable where T: ParseObject { - key: A tuple consisting of the key and the respective `KeyPath` of the object. - returns: The updated operations. */ - public func unset(_ key: (String, WritableKeyPath)) -> Self where V: Encodable { + public func unset(_ key: (String, WritableKeyPath)) -> Self where V: Codable { var mutableOperation = self - mutableOperation.operations[key.0] = Delete() + mutableOperation.operations[key.0] = ParseOperationDelete() mutableOperation.target[keyPath: key.1] = nil return mutableOperation } @@ -390,3 +425,22 @@ public extension ParseObject { return ParseOperation(target: self) } } + +// MARK: CustomDebugStringConvertible +public extension ParseOperation { + var debugDescription: String { + guard let descriptionData = try? ParseCoding.jsonEncoder().encode(self), + let descriptionString = String(data: descriptionData, encoding: .utf8) else { + return "()" + } + + return "\(descriptionString)" + } +} + +// MARK: CustomStringConvertible +public extension ParseOperation { + var description: String { + debugDescription + } +} diff --git a/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushAppleAlert.swift b/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushAppleAlert.swift index bb5713efe..2127ae650 100644 --- a/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushAppleAlert.swift +++ b/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushAppleAlert.swift @@ -84,7 +84,7 @@ public struct ParsePushAppleAlert: ParseTypeable { public var actionLocKey: String? /// Create an empty alert. - public init() { } + public init() {} /// Create an alert with a body message. /// - parameter body: The message to send in the alert. diff --git a/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushPayloadApple.swift b/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushPayloadApple.swift index 35cca8c4e..994e858bf 100644 --- a/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushPayloadApple.swift +++ b/Sources/ParseSwift/Types/ParsePushPayload/Apple/ParsePushPayloadApple.swift @@ -95,7 +95,7 @@ public struct ParsePushPayloadApple: ParsePushApplePayloadable { urlArgs } - public init() { } + public init() {} /** Create an instance of `ParsePushPayloadApple` . @@ -202,7 +202,7 @@ public struct ParsePushPayloadApple: ParsePushApplePayloadable { */ public func incrementBadge() -> Self { var mutablePayload = self - mutablePayload.badge = AnyCodable(Increment(amount: 1)) + mutablePayload.badge = AnyCodable(ParseOperationIncrement(amount: 1)) return mutablePayload } } diff --git a/Sources/ParseSwift/Types/ParsePushPayload/Firebase/ParsePushPayloadFirebase.swift b/Sources/ParseSwift/Types/ParsePushPayload/Firebase/ParsePushPayloadFirebase.swift index 412d24cd1..88e3bbc2b 100644 --- a/Sources/ParseSwift/Types/ParsePushPayload/Firebase/ParsePushPayloadFirebase.swift +++ b/Sources/ParseSwift/Types/ParsePushPayload/Firebase/ParsePushPayloadFirebase.swift @@ -53,7 +53,7 @@ public struct ParsePushPayloadFirebase: ParsePushFirebasePayloadable { case high } - public init() { } + public init() {} /** Create a new instance of `ParsePushPayloadFirebase`. diff --git a/Sources/ParseSwift/Types/ParsePushPayload/ParsePushPayloadAny.swift b/Sources/ParseSwift/Types/ParsePushPayload/ParsePushPayloadAny.swift index eb3586b1a..c4949864c 100644 --- a/Sources/ParseSwift/Types/ParsePushPayload/ParsePushPayloadAny.swift +++ b/Sources/ParseSwift/Types/ParsePushPayload/ParsePushPayloadAny.swift @@ -88,7 +88,7 @@ public struct ParsePushPayloadAny: ParsePushApplePayloadable, ParsePushFirebaseP notification = try values.decodeIfPresent(ParsePushFirebaseNotification.self, forKey: .key("notification")) } - public init() { } + public init() {} /** Convert the current `ParsePushPayloadAny` to `ParsePushPayloadApple`. diff --git a/Sources/ParseSwift/Types/ParsePushStatus.swift b/Sources/ParseSwift/Types/ParsePushStatus.swift index 02ed6d7ee..19f07c276 100644 --- a/Sources/ParseSwift/Types/ParsePushStatus.swift +++ b/Sources/ParseSwift/Types/ParsePushStatus.swift @@ -62,7 +62,7 @@ public struct ParsePushStatus: ParsePushStatusable { public var count: Int? - public init() { } + public init() {} enum CodingKeys: String, CodingKey { case expirationInterval = "expiration_interval" diff --git a/Sources/ParseSwift/Types/ParseSchema.swift b/Sources/ParseSwift/Types/ParseSchema.swift index 32ff6d1d7..4b9c713be 100644 --- a/Sources/ParseSwift/Types/ParseSchema.swift +++ b/Sources/ParseSwift/Types/ParseSchema.swift @@ -225,7 +225,7 @@ public extension ParseSchema { - returns: A mutated instance of `ParseSchema` for easy chaining. */ func deleteIndex(_ name: String) -> Self { - let index = ["__op": AnyCodable(Operation.delete.rawValue)] + let index = ["__op": AnyCodable(ParseOperationCommand.delete.rawValue)] var mutableSchema = self mutableSchema.pendingIndexes[name] = index return mutableSchema diff --git a/Sources/ParseSwift/Types/Query.swift b/Sources/ParseSwift/Types/Query.swift index 1a54e68d5..6ecc8ba2d 100644 --- a/Sources/ParseSwift/Types/Query.swift +++ b/Sources/ParseSwift/Types/Query.swift @@ -3,7 +3,7 @@ // Parse // // Created by Florent Vilmart on 17-07-23. -// Copyright © 2020 Network Reconnaissance Lab. All rights reserved. +// Copyright © 2020 Parse. All rights reserved. // import Foundation diff --git a/Tests/ParseSwiftTests/KeychainStoreTests.swift b/Tests/ParseSwiftTests/KeychainStoreTests.swift index 8bf055058..8a63dbb29 100644 --- a/Tests/ParseSwiftTests/KeychainStoreTests.swift +++ b/Tests/ParseSwiftTests/KeychainStoreTests.swift @@ -3,7 +3,7 @@ // ParseSwift // // Created by Florent Vilmart on 17-09-25. -// Copyright © 2020 Network Reconnaissance Lab. All rights reserved. +// Copyright © 2020 Parse. All rights reserved. // #if !os(Linux) && !os(Android) && !os(Windows) diff --git a/Tests/ParseSwiftTests/ParseCLPTests.swift b/Tests/ParseSwiftTests/ParseCLPTests.swift index 6234e7d42..82a763c3f 100644 --- a/Tests/ParseSwiftTests/ParseCLPTests.swift +++ b/Tests/ParseSwiftTests/ParseCLPTests.swift @@ -31,7 +31,7 @@ class ParseCLPTests: XCTestCase { // swiftlint:disable:this type_body_length // Your custom keys var customKey: String? - init() { } + init() {} } struct Role: ParseRole { diff --git a/Tests/ParseSwiftTests/ParseObjectAsyncTests.swift b/Tests/ParseSwiftTests/ParseObjectAsyncTests.swift index 90c16710c..c00c8c05d 100644 --- a/Tests/ParseSwiftTests/ParseObjectAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseObjectAsyncTests.swift @@ -47,7 +47,7 @@ class ParseObjectAsyncTests: XCTestCase { // swiftlint:disable:this type_body_le return updated } - init() { } + init() {} // custom initializers init (objectId: String?) { diff --git a/Tests/ParseSwiftTests/ParseOperationAsyncTests.swift b/Tests/ParseSwiftTests/ParseOperationAsyncTests.swift index 8f703ee0b..c800d7ce0 100644 --- a/Tests/ParseSwiftTests/ParseOperationAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseOperationAsyncTests.swift @@ -26,7 +26,7 @@ class ParseOperationAsyncTests: XCTestCase { var points: Int? var player: String? - init() { } + init() {} // custom initializers init (objectId: String?) { self.objectId = objectId diff --git a/Tests/ParseSwiftTests/ParseOperationTests.swift b/Tests/ParseSwiftTests/ParseOperationTests.swift index ccd1811d6..2a3cd807b 100644 --- a/Tests/ParseSwiftTests/ParseOperationTests.swift +++ b/Tests/ParseSwiftTests/ParseOperationTests.swift @@ -23,6 +23,7 @@ class ParseOperationTests: XCTestCase { //: Your own properties var points: Int? + var otherPoints: Double? var members: [String]? var levels: [String]? var previous: [Level]? @@ -37,6 +38,12 @@ class ParseOperationTests: XCTestCase { self.next = [Level(level: 5)] self.members = [String]() } + + init(otherPoints: Double) { + self.otherPoints = otherPoints + self.next = [Level(level: 5)] + self.members = [String]() + } } struct Level: ParseObject { @@ -449,6 +456,25 @@ class ParseOperationTests: XCTestCase { XCTAssertEqual(decoded, expected) } + func testIncrementDescription() throws { + let score = GameScore(points: 10) + let operations = score.operation + .increment("points", by: 1) + let expected = "{\"points\":{\"__op\":\"Increment\",\"amount\":1}}" + XCTAssertEqual(operations.description, expected) + } + + func testIncrementDouble() throws { + let score = GameScore(otherPoints: 10.0) + let operations = score.operation + .increment("otherPoints", by: 1.1) + let encoded = try ParseCoding.parseEncoder() + .encode(operations) + let decoded = try XCTUnwrap(String(data: encoded, encoding: .utf8)) + XCTAssertTrue(decoded.contains("otherPoints\":{\"__op\":\"Increment\",\"amount\":")) + XCTAssertTrue(decoded.contains("1.1")) + } + func testAdd() throws { let score = GameScore(points: 10) let operations = score.operation @@ -571,6 +597,46 @@ class ParseOperationTests: XCTestCase { XCTAssertEqual(decoded, expected) } + func testOperationAddDescription() throws { + let add = ParseOperationAdd(objects: ["hello"]) + let expected = "{\"__op\":\"Add\",\"objects\":[\"hello\"]}" + XCTAssertEqual(add.description, expected) + } + + func testBatch() throws { + let score = GameScore(points: 10) + let add = ParseOperationAdd(objects: ["hello"]) + let remove = ParseOperationRemove(objects: ["world"]) + let batch = ParseOperationBatch(operations: [add]) + .appendOperations(operations: [remove]) + let operations = score.operation + .batch("test", operations: batch) + // swiftlint:disable:next line_length + let expected = "{\"test\":{\"__op\":\"Batch\",\"ops\":[{\"__op\":\"Add\",\"objects\":[\"hello\"]},{\"__op\":\"Remove\",\"objects\":[\"world\"]}]}}" + let encoded = try ParseCoding.parseEncoder() + .encode(operations) + let decoded = try XCTUnwrap(String(data: encoded, encoding: .utf8)) + XCTAssertEqual(decoded, expected) + } + + func testBatchRelations() throws { + let score = GameScore(points: 10) + var score2 = GameScore(points: 20) + score2.objectId = "yolo" + let add = try ParseOperationAddRelation(objects: [score2]) + let remove = try ParseOperationRemoveRelation(objects: [score2]) + let batch = ParseOperationBatch(operations: [add]) + .appendOperations(operations: [remove]) + let operations = score.operation + .batch("test", operations: batch) + // swiftlint:disable:next line_length + let expected = "{\"test\":{\"__op\":\"Batch\",\"ops\":[{\"__op\":\"AddRelation\",\"objects\":[{\"__type\":\"Pointer\",\"className\":\"GameScore\",\"objectId\":\"yolo\"}]},{\"__op\":\"RemoveRelation\",\"objects\":[{\"__type\":\"Pointer\",\"className\":\"GameScore\",\"objectId\":\"yolo\"}]}]}}" + let encoded = try ParseCoding.parseEncoder() + .encode(operations) + let decoded = try XCTUnwrap(String(data: encoded, encoding: .utf8)) + XCTAssertEqual(decoded, expected) + } + func testSet() throws { let score = GameScore(points: 10) let operations = score.operation.set(("points", \.points), to: 15) diff --git a/Tests/ParseSwiftTests/ParsePushTests.swift b/Tests/ParseSwiftTests/ParsePushTests.swift index cf9c3dfa1..be3ba5e4f 100644 --- a/Tests/ParseSwiftTests/ParsePushTests.swift +++ b/Tests/ParseSwiftTests/ParsePushTests.swift @@ -61,7 +61,7 @@ internal struct ParsePushStatusResponse: ParseObject { var count: Int? - init() { } + init() {} func setQueryWhere(_ query: QueryWhere) throws -> Self { var mutatingResponse = self diff --git a/Tests/ParseSwiftTests/ParseQueryAsyncTests.swift b/Tests/ParseSwiftTests/ParseQueryAsyncTests.swift index 8e763abfb..b1f54dc23 100644 --- a/Tests/ParseSwiftTests/ParseQueryAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseQueryAsyncTests.swift @@ -25,7 +25,7 @@ class ParseQueryAsyncTests: XCTestCase { // swiftlint:disable:this type_body_len //: Your own properties var points: Int? var player: String? - init() { } + init() {} // custom initializers init (objectId: String?) { self.objectId = objectId diff --git a/Tests/ParseSwiftTests/ParseSchemaTests.swift b/Tests/ParseSwiftTests/ParseSchemaTests.swift index 59c6b64c9..c4c528dec 100644 --- a/Tests/ParseSwiftTests/ParseSchemaTests.swift +++ b/Tests/ParseSwiftTests/ParseSchemaTests.swift @@ -26,7 +26,7 @@ class ParseSchemaTests: XCTestCase { // swiftlint:disable:this type_body_length var points: Int? //: a custom initializer - init() { } + init() {} init(points: Int) { self.points = points } @@ -45,7 +45,7 @@ class ParseSchemaTests: XCTestCase { // swiftlint:disable:this type_body_length var points: Int? //: Custom initializers - init() { } + init() {} init(points: Int) { self.points = points