-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSyncProtocol.h
More file actions
77 lines (68 loc) · 2.42 KB
/
SyncProtocol.h
File metadata and controls
77 lines (68 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// SyncProtocol.h
// ContentstackPersistence
//
// Created by Uttam Ukkoji on 30/07/18.
// Copyright © 2018 Contentstack. All rights reserved.
//
#ifndef SyncProtocol_h
#define SyncProtocol_h
/**
Base protocol for all `AssetProtocol` and `EntryProtocol`.
*/
@protocol ContentStackProtocol<NSObject>
@required
/// The title of the Resource.
@property (nonatomic)NSString *title;
/// The url of the Resource.
@property (nonatomic)NSString *url;
/// The unique identifier of the Resource.
@property (nonatomic)NSString *uid;
/// The code which represents which locale the Resource of interest contains data for.
@property (nonatomic)NSString *publishLocale;
/// The date representing the last time the Contentful Resource was created.
@property (nonatomic)NSDate *createdAt;
/// The date representing the last time the Contentful Resource was updated.
@property (nonatomic)NSDate *updatedAt;
@end
/**
Your subclass should conform to this `SyncStoreProtocol` to enable continuing
a sync from a sync token on subsequent launches of your application rather than re-fetching all data during an initialSync.
*/
@protocol SyncStoreProtocol<NSObject>
@required
@property (nonatomic)NSString* paginationToken;
@property (nonatomic)NSString* syncToken;
@property (nonatomic)NSString* seqId;
@end
/**
Conform to `EntryProtocol` protocol to enable mapping of your ContentStack content type to
your subclass.
*/
@protocol EntryProtocol<ContentStackProtocol>
@required
/// The code which represents which locale the Resource of interest contains data for.
@property (nonatomic)NSString *locale;
/// The identifier of the ContentStack content type that will map to this type of `EntryProtocol`
+(NSString*)contentTypeid;
/// This method must be implemented to provide a custom mapping from ContentStack fields to Swift properties.
+(NSDictionary *)fieldMapping;
@end
/**
Conform to `EntryGroupProtocol` protocol to enable mapping of your ContentStack content type to your subclass.
*/
@protocol EntryGroupProtocol
@required
/// This method must be implemented to provide a custom mapping from ContentStack fields to Swift properties.
+(NSDictionary *)fieldMapping;
@end
/**
Conform to `AssetProtocol` protocol to enable mapping of your ContentStack media Assets to
your subclass.
*/
@protocol AssetProtocol<ContentStackProtocol>
@required
/// The name of the underlying binary media file.
@property (nonatomic)NSString *fileName;
@end
#endif /* SyncProtocol_h */