CKKSFetchAllRecordZoneChangesOperation.h [plain text]
#import <Foundation/Foundation.h>
#if OCTAGON
@class CKKSKeychainView;
#import "keychain/ckks/CKKSGroupOperation.h"
#import "keychain/ckks/CloudKitDependencies.h"
NS_ASSUME_NONNULL_BEGIN
@protocol CKKSFetchBecauseProtocol <NSObject>
@end
typedef NSString<CKKSFetchBecauseProtocol> CKKSFetchBecause;
extern CKKSFetchBecause* const CKKSFetchBecauseAPNS;
extern CKKSFetchBecause* const CKKSFetchBecauseAPIFetchRequest;
extern CKKSFetchBecause* const CKKSFetchBecauseCurrentItemFetchRequest;
extern CKKSFetchBecause* const CKKSFetchBecauseInitialStart;
extern CKKSFetchBecause* const CKKSFetchBecauseSecuritydRestart;
extern CKKSFetchBecause* const CKKSFetchBecausePreviousFetchFailed;
extern CKKSFetchBecause* const CKKSFetchBecauseKeyHierarchy;
extern CKKSFetchBecause* const CKKSFetchBecauseTesting;
extern CKKSFetchBecause* const CKKSFetchBecauseResync;
@interface CKKSCloudKitFetchRequest : NSObject
@property bool participateInFetch;
@property (nullable) CKServerChangeToken* changeToken;
@end
@class CKKSCloudKitDeletion;
@protocol CKKSChangeFetcherClient <NSObject>
- (CKRecordZoneID*)zoneID;
- (CKKSCloudKitFetchRequest*)participateInFetch;
- (bool)shouldRetryAfterFetchError:(NSError*)error;
- (void)changesFetched:(NSArray<CKRecord*>*)changedRecords
deletedRecordIDs:(NSArray<CKKSCloudKitDeletion*>*)deleted
oldChangeToken:(CKServerChangeToken* _Nullable)oldChangeToken
newChangeToken:(CKServerChangeToken*)changeToken;
@end
@interface CKKSCloudKitDeletion : NSObject
@property CKRecordID* recordID;
@property NSString* recordType;
- (instancetype)initWithRecordID:(CKRecordID*)recordID recordType:(NSString*)recordType;
@end
@interface CKKSFetchAllRecordZoneChangesOperation : CKKSGroupOperation
@property (readonly) Class<CKKSFetchRecordZoneChangesOperation> fetchRecordZoneChangesOperationClass;
@property (readonly) CKContainer* container;
@property bool resync;
@property NSDictionary<CKRecordZoneID*, id<CKKSChangeFetcherClient>>* clientMap;
@property (nullable) NSMutableArray<CKRecordZoneID*>* fetchedZoneIDs;
@property NSSet<CKKSFetchBecause*>* fetchReasons;
@property NSSet<CKRecordZoneNotification*>* apnsPushes;
@property NSMutableDictionary<CKRecordID*, CKRecord*>* modifications;
@property NSMutableDictionary<CKRecordID*, CKKSCloudKitDeletion*>* deletions;
@property NSMutableDictionary<CKRecordZoneID*, CKServerChangeToken*>* changeTokens;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithContainer:(CKContainer*)container
fetchClass:(Class<CKKSFetchRecordZoneChangesOperation>)fetchRecordZoneChangesOperationClass
clients:(NSArray<id<CKKSChangeFetcherClient>>*)clients
fetchReasons:(NSSet<CKKSFetchBecause*>*)fetchReasons
apnsPushes:(NSSet<CKRecordZoneNotification*>* _Nullable)apnsPushes
forceResync:(bool)forceResync
ckoperationGroup:(CKOperationGroup*)ckoperationGroup;
@end
NS_ASSUME_NONNULL_END
#endif