-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathQuery.h
More file actions
807 lines (578 loc) · 23.8 KB
/
Query.h
File metadata and controls
807 lines (578 loc) · 23.8 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
13
8000
5
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
//
// Query.h
// Contentstack
//
// Created by Reefaq on 22/06/15.
// Copyright (c) 2015 Contentstack. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Contentstack/ContentstackDefinitions.h>
@class QueryResult;
@class Entry;
BUILT_ASSUME_NONNULL_BEGIN
@interface Query : NSObject
- (instancetype)init UNAVAILABLE_ATTRIBUTE;
/**----------------------------------------------------------------------------------------
* @name Properties
*-----------------------------------------------------------------------------------------
*/
/**
* property to assign cache policy like CACHE_THEN_NETWORK, NETWORK_ELSE_CACHE, NETWORK_ONLY, etc.
*/
@property (nonatomic, assign) CachePolicy cachePolicy;
//MARK: Manually set headers -
/**---------------------------------------------------------------------------------------
* @name Manually set headers
* ---------------------------------------------------------------------------------------
*/
/**
Set a header for an query
//Obj-C
Query *blogQuery = [contentTypeObj query];
[blogQuery setHeader:@"MyHeaderValue" forKey:@"My-Custom-Header-Key"];
//Swift
var blogQuery:Query = contentTypeObj.query()
blogQuery.setHeader("MyHeaderValue", forKey:"My-Custom-Header-Key")
@param headerValue The header key
@param headerKey The header value
*/
- (void)setHeader:(NSString *)headerValue forKey:(NSString *)headerKey;
/**
Set a header for an query
//Obj-C
Query *blogQuery = [contentTypeObj query];
[blogQuery addHeadersWithDictionary:@{@"My-Custom-Header-Key":@"MyHeaderValue"}];
//Swift
var blogQuery:Query = contentTypeObj.query()
blogQuery.addHeadersWithDictionary(["My-Custom-Header-Key":"MyHeaderValue"])
@param headers The headers as dictionary which needs to be added to the application
*/
- (void)addHeadersWithDictionary:(NSDictionary<NSString *, NSString *> *)headers;
/**
Removes a header from this query.
//Obj-C
Query *blogQuery = [contentTypeObj query];
[blogQuery removeHeaderForKey:@"My-Custom-Header-Key"];
//Swift
var blogQuery:Query = contentTypeObj.query()
blogQuery.removeHeaderForKey("My-Custom-Header-Key")
@param headerKey The header key that needs to be removed
*/
- (void)removeHeaderForKey:(NSString *)headerKey;
//MARK: - Language -
/**---------------------------------------------------------------------------------------
* @name Language
* ---------------------------------------------------------------------------------------
*/
/**
This method provides all the entries for the specified language in the response.
//Obj-C
[blogQuery language:ENGLISH_UNITED_STATES];
//Swift
blogQuery.language(Language.ENGLISH_UNITED_STATES)
@param language Language enum for all language available.
*/
- (void)language:(Language)language __attribute((deprecated("Use the locale: instead.")));
/**
This method provides all the entries for the specified language in the response.
//Obj-C
[blogQuery locale:@"en-us"];
//Swift
blogQuery.locale("en-us")
@param locale Language enum for all language available.
*/
- (void)locale:(NSString *)locale;
//MARK: - Search -
/**---------------------------------------------------------------------------------------
* @name Search
* ---------------------------------------------------------------------------------------
*/
/**
This method provides only the entries matching the specified value.
//Obj-C
[blogQuery search:@"header"];
//Swift
blogQuery.search(@"header")
@param searchString The value used to match or compare
*/
- (void)search:(NSString *)searchString;
- (void)query:(NSDictionary *)queryString;
//MARK: - Tags -
/**---------------------------------------------------------------------------------------
* @name Tags
* ---------------------------------------------------------------------------------------
*/
/**
This method provides only the entries that contain tags matching the ones mentioned in the function.
//Obj-C
[blogQuery tags:@[@"phone", @"laptop"]];
//Swift
blogQuery.tags(["phone", "laptop"])
@param tagsArray An array of tags that are to be included for the key
*/
- (void)tags:(NSArray<NSString *> *)tagsArray;
//MARK: Subqueryies with AND / OR -
/**---------------------------------------------------------------------------------------
* @name Subqueries with AND / OR
* ---------------------------------------------------------------------------------------
*/
/**
This method performs the OR operation on the specified query objects and provides only the matching entries.
//Obj-C
Query *query1 = [contentTypeObj query];
[query1 whereKey:@"title" equalTo:@"Welcome"];
Query *query2 = [contentTypeObj query];
[query2 whereKey:@"introduction" equalTo:@"This is Test"];
[blogQuery orWithSubqueries:@[query1, query2]];
//Swift
var query1:Query = contentTypeObj.query()
query1.whereKey("title", equalTo:"Welcome")
var query2:Query = contentTypeObj.query()
query2.whereKey("introduction", equalTo:"This is Test")
blogQuery.orWithSubqueries([query1, query2])
@param queries Array of queries to be taken into consideration
*/
- (void)orWithSubqueries:(NSArray<Query *> *)queries;
/**
This method performs the AND operation on the specified query objects and provides only the matching entries.
//Obj-C
Query *query1 = [contentTypeObj query];
[query1 whereKey:@"total_hits" greaterThanOrEqualTo:@(800)];
Query *query2 = [contentTypeObj query];
[query2 whereKey:@"total_hits" lessThanOrEqualTo:@(1200)];
[blogQuery andWithSubqueries:@[query1, query2]];
//Swift
var query1:Query = contentTypeObj.query()
query1.whereKey("total_hits", greaterThanOrEqualTo:800)
var query2:Query = contentTypeObj.query()
query2.whereKey("total_hits", equalTo:1200)
blogQuery.andWithSubqueries([query1, query2])
@param queries Array of queries to be taken into consideration
*/
- (void)andWithSubqueries:(NSArray<Query *> *)queries;
//MARK: - Sorting
/**---------------------------------------------------------------------------------------
* @name Sorting
* ---------------------------------------------------------------------------------------
*/
/**
Sorts the provided entries in the ascending order on the basis of the specified field.
//Obj-C
[blogQuery orderByAscending:@"updated_at"];
//Swift
blogQuery.orderByAscending("updated_at")
@param key field uid based on which the ordering should be done.
*/
- (void)orderByAscending:(NSString *)key;
/**
Sorts the provided entries in the descending order on the basis of the specified field.
//Obj-C
[blogQuery orderByDescending:@"updated_at"];
//Swift
blogQuery.orderByDescending("updated_at")
@param key field uid based on which the ordering should be done.
*/
- (void)orderByDescending:(NSString *)key;
//MARK: Include -
/**---------------------------------------------------------------------------------------
* @name Include
* ---------------------------------------------------------------------------------------
*/
/**
Provides only the number of entries with values matching the specified values for a field.
//Obj-C
[blogQuery objectsCount];
//Swift
blogQuery.objectsCount()
*/
- (void)objectsCount;
/**
This method also includes the contenttype for the entries returned in the response.
//Obj-C
[blogQuery includeContentType];
//Swift
blogQuery.includeContentType()
*/
- (void)includeContentType;
/**
Retrieve the published content of the fallback locale entry if the entry is not localized in specified locale.
//Obj-C
[blogQuery includeFallback];
//Swift
blogQuery.includeFallback()
*/
-(void)includeFallback;
/**
Include the metadata for getting metadata content for the entry.
//Obj-C
[blogQuery includeMetadata];
//Swift
blogQuery.includeMetadata()
*/
-(void)includeMetadata;
/**
Retrieve the branch for the published content.
//Obj-C
[blogQuery includeBranch];
//Swift
blogQuery.includeBranch()
*/
-(void)includeBranch;
/**
This method also includes the content type UIDs of the referenced entries returned in the response.
//Obj-C
[blogQuery includeReferenceContentTypeUid];
//Swift
blogQuery.includeReferenceContentTypeUid()
*/
- (void)includeReferenceContentTypeUid;
/**
Include Embedded Objects (Entries and Assets) along with entry/entries details.
//Obj-C
[blogQuery includeEmbeddedItems];
//Swift
blogQuery.includeEmbeddedItems()
*/
- (void)includeEmbeddedItems;
/**
This method also includes owner information for all the entries returned in the response.
//Obj-C
[blogQuery includeOwner];
//Swift
blogQuery.includeOwner()
*/
- (void)includeOwner;
/**
This method also includes the total number of entries returned in the response.
//Obj-C
[blogQuery includeCount];
//Swift
blogQuery.includeCount()
*/
- (void)includeCount;
//MARK: Pagination -
/**---------------------------------------------------------------------------------------
* @name Pagination
* ---------------------------------------------------------------------------------------
*/
/**
This method limits the response by providing only the specified number of entries.
//Obj-C
[blogQuery limitObjects:@(5)];
//Swift
blogQuery.limitObjects(NSNumber(int:5))
@param number Number of entries to be returned
*/
- (void)limitObjects:(NSNumber *)number;
/**
This method limits the response by providing only the specified number of entries.
//Obj-C
[blogQuery skipObjects:@(5)];
//Swift
blogQuery.skipObjects(NSNumber(int:5))
@param number Number of entries to be returned
*/
- (void)skipObjects:(NSNumber *)number;
//MARK: Adding Basic Constraints -
/**---------------------------------------------------------------------------------------
* @name Adding Basic Constraints
* ---------------------------------------------------------------------------------------
*/
/**
Include custom query using a key and a value.
//Obj-C
[blogQuery addQueryWithKey:@"key_name" andValue:@"MyValue"];
//Swift
blogQuery.addQueryWithKey("key_name", andValue:"MyValue")
@discussion Include custom query using a key and a value.
@param key name of the query.
@param value value for the query.
*/
- (void)addQueryWithKey:(NSString *)key andValue:(id)value;
/**
A custom dictionary can be provided to a query that can specify the conditions for retrieving objects.
//Obj-C
[blogQuery addQueryParams:@{@"Query_Key":@"Query Value"}];
//Swift
blogQuery.addQueryParams(["Query_Key":"Query Value"])
@param queryDict A dictionary with all the necessary conditions for retrieving objects.
@discussion If a complex query needs to be performed and if it is difficult to specify it using the query methods, a dictionary can be provided that specifies all the conditions. The dictionary should be as per the JSON format specified in the REST API docs.
*/
- (void)addQueryParams:(NSDictionary<NSString *, id> *)queryDict;
/**
Removes custom query.
//Obj-C
[blogQuery removeQueryWithKey:@"Query_Key"];
//Swift
blogQuery.removeQueryWithKey("Query_Key")
@param key name of the query.
*/
- (void)removeQueryWithKey:(NSString *)key;
/**
This method provides only the entries matching the specified value for a field.
//Obj-C
[blogQuery whereKey:@"title" equalTo:@"Welcome"];
//Swift
blogQuery.whereKey("title", equalTo:"Welcome")
@param key Uid of the field that is to be taken into consideration
@param object The value used to match or compare
*/
- (void)whereKey:(NSString *)key equalTo:(id)object;
/**
This method provides only the entries with values not equal to the specified value for a field.
//Obj-C
[blogQuery whereKey:@"titl
B943
e" notEqualTo:@"Welcome"];
//Swift
blogQuery.whereKey("title", notEqualTo:"Welcome")
@param key Uid of the field that is to be taken into consideration
@param object The value used to match or compare
*/
- (void)whereKey:(NSString *)key notEqualTo:(id)object;
/**
This method provides only the entries with a values less than the specified value for a field.
//Obj-C
[blogQuery whereKey:@"created_at" lessThan:@"2015-06-22"];
//Swift
blogQuery.whereKey("created_at", lessThan:"2015-06-22")
@param key Uid of the field that is to be taken into consideration
@param object The value used to match or compare
*/
- (void)whereKey:(NSString *)key lessThan:(id)object;
/**
This method provides only the entries with values greater than the specified value for a field.
//Obj-C
[blogQuery whereKey:@"created_at" greaterThan:@"2015-03-12"];
//Swift
blogQuery.whereKey("created_at", greaterThan:"2015-03-12")
@param key Uid of the field that is to be taken into consideration
@param object The value used to match or compare
*/
- (void)whereKey:(NSString *)key greaterThan:(id)object;
/**
This method provides only the entries with values less than or equal to the specified value for a field.
//Obj-C
[blogQuery whereKey:@"created_at" lessThanOrEqualTo:@"2015-03-12"];
//Swift
blogQuery.whereKey("created_at", lessThanOrEqualTo:"2015-03-12")
@param key Uid of the field that is to be taken into consideration
@param object The value used to match or compare
*/
- (void)whereKey:(NSString *)key lessThanOrEqualTo:(id)object;
/**
This method provides only the entries with values greater than or equal to the specified value for a field.
//Obj-C
[blogQuery whereKey:@"created_at" greaterThanOrEqualTo:@"2015-03-12"];
//Swift
blogQuery.whereKey("created_at", greaterThanOrEqualTo:"2015-03-12")
@param key Uid of the field that is to be taken into consideration
@param object The value used to match or compare
*/
- (void)whereKey:(NSString *)key greaterThanOrEqualTo:(id)object;
/**
This method provides only the entries with values matching the specified values for a field.
//Obj-C
[blogQuery whereKey:@"title" containedIn:@["Demo", @"Welcome"]];
//Swift
blogQuery.whereKey("title", containedIn:["Demo", "Welcome"])
@param key Uid of the field that is to be taken into consideration
@param array An array of values that are to be used to match or compare
*/
- (void)whereKey:(NSString *)key containedIn:(NSArray *)array;
/**
This method provides only the entries that do not contain values matching the specified values for a field.
//Obj-C
[blogQuery whereKey:@"title" notContainedIn:@["Demo", @"Welcome"]];
//Swift
blogQuery.whereKey("title", notContainedIn:["Demo", "Welcome"])
@param key Uid of the field that is to be taken into consideration
@param array An array of values that are to be used to match or compare
*/
- (void)whereKey:(NSString *)key notContainedIn:(NSArray *)array;
/**
This method provides only the entries that contains the field matching the specified field uid.
//Obj-C
[blogQuery whereKeyExists:@"introduction"];
//Swift
blogQuery.whereKeyExists("introduction")
@param key Uid of the field that is to be taken into consideration
*/
- (void)whereKeyExists:(NSString *)key;
/**
This method provides only the entries that do not contain the field matching the specified field uid.
//Obj-C
[blogQuery whereKeyDoesNotExist:@"introduction"];
//Swift
blogQuery.whereKeyDoesNotExist("introduction")
@param key Uid of the field that is to be taken into consideration
*/
- (void)whereKeyDoesNotExist:(NSString *)key;
/**
This method provides only the entries matching the regular expression for the specified field.
//Obj-C
[blogQuery whereKey:@"title" matchesRegex:@"^wel"];
//Swift
blogQuery.whereKey("title", matchesRegex:"^wel")
@param key Uid of the field that is to be taken into consideration
@param regex The value used to match or compare
*/
- (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex;
/**
This method provides only the entries matching the regular expression for the specified field.
//Obj-C
[blogQuery whereKey:@"title" matchesRegex:@"^wel" modifiers:@"i"];
//Swift
blogQuery.whereKey("title", matchesRegex:"^wel", modifiers:"i")
@param key Uid of the field that is to be taken into consideration
@param regex The value used to match or compare
@param modifier Modifiers for regex options. Specify 'i' as the option to ignore the case.
*/
- (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex modifiers:(NSString *)modifier;
/**
This method provides only the entries matching the Query.
//Obj-C
Query *reference = [contentTypeObj query];
[reference whereKey:@"name" equalTo:@"Author"];
[blogQuery whereKey:@"author" in:reference];
//Swift
var reference:Query = contentTypeObj.query()
reference.whereKey("name", equalTo:@"Author")
blogQuery.whereKey("author", in:reference)
@param key Reference Uid of the field that is to be taken into consideration
@param query Querie to be taken into consideration
*/
- (void)whereKey:(NSString *)key in:(Query *)query;
/**
This method provides only the entries matching the Query.
//Obj-C
Query *reference = [contentTypeObj query];
[reference whereKey:@"name" equalTo:@"Author"];
[blogQuery whereKey:@"author" notIn:reference];
//Swift
var reference:Query = contentTypeObj.query()
reference.whereKey("name", equalTo:@"Author")
blogQuery.whereKey("author", notIn:reference)
@param key Reference Uid of the field that is to be taken into consideration
@param query Querie to be taken into consideration
<
527D
/div> */
- (void)whereKey:(NSString *)key notIn:(Query *)query;
//MARK: Selective fields using only/except -
/**---------------------------------------------------------------------------------------
* @name Selective fields using only/except
* ---------------------------------------------------------------------------------------
*/
/**
This method provides only the entries that match the specified field uids and corresponding values.
//Obj-C
[blogQuery onlyFields:@[@"attachments"]];
//Swift
blogQuery.onlyFields(["attachments"])
@param fieldUIDs An array of values that are to be included for the key
*/
- (void)onlyFields:(NSArray<NSString *> *)fieldUIDs;
/**
This method provides all entries except those that match the specified field uids and corresponding values.
//Obj-C
[blogQuery exceptFields:@[@"attachments"]];
//Swift
blogQuery.exceptFields(["attachments"])
@param fieldUIDs An array of values that are to be included for the key
*/
- (void)exceptFields:(NSArray<NSString *> *)fieldUIDs;
//MARK: Reference Query (Query Conditions on Reference fields) -
/**---------------------------------------------------------------------------------------
* @name Reference Query (Query Conditions on Reference fields)
* ---------------------------------------------------------------------------------------
*/
/**
This method provides all entries that also contain data from the referred entry in the specified field.
//Obj-C
[blogQuery includeReferenceFieldWithKey:@"entry_a"];
//Swift
blogQuery.includeReferenceFieldWithKey(@"entry_a")
@param key Uid of the reference field that is to be taken into consideration
*/
- (void)includeReferenceFieldWithKey:(NSArray<NSString *> *)key;
/**
This method provides all entries incuding referred entry containing only specified fields.
//Obj-C
[blogQuery includeReferenceFieldWithKey:@"reference_field_uid" onlyFields:@[@"attachments"]];
//Swift
blogQuery.includeReferenceFieldWithKey(@"reference_field_uid", onlyFields:["attachments"])
@param key Uid of the reference field that is to be taken into consideration
@param fieldUIDs Uid of the reference field that is to be taken into consideration
*/
- (void)includeReferenceFieldWithKey:(NSString *)key onlyFields:(NSArray<NSString *> *)fieldUIDs;
/**
This method provides all entries incuding referred entry containing all fields except specified fields.
//Obj-C
[blogQuery includeReferenceFieldWithKey:@"entry_a" excludingFields:@[@"attachments"]];
//Swift
blogQuery.includeReferenceFieldWithKey(@"entry_a", excludingFields:["attachments"])
@param key Uid of the reference field that is to be taken into consideration
@param fieldUIDs Uid of the reference field that is to be taken into consideration
*/
- (void)includeReferenceFieldWithKey:(NSString *)key excludingFields:(NSArray<NSString *
8574
> *)fieldUIDs;
/**
This method adds key and value to a query.
//Obj-C
Query *blogQuery = [contentTypeObj query];
[blogQuery addParamKey:@"key" andValue:@"value"];
//Swift
var blogQuery:Query = contentTypeObj.query()
blogQuery.addParamKey("key", andValue:"value")
@param key The key as string which needs to be added to the Query
@param value The value as string which needs to be added to the Query
*/
- (void)addParamKey:(NSString *)key andValue:(NSString *)value;
//MARK: Execute Query -
/**---------------------------------------------------------------------------------------
* @name Execute Query
* ---------------------------------------------------------------------------------------
*/
/**
This method provides all the entries from a specified contenttype.
//Obj-C
[blogQuery find:^(ResponseType type, QueryResult *result, NSError *error) {
//error for any error description
//result for reponse data
}];
//Swift
blogQuery.find { (responseType, result!, error!) -> Void in
//error for any error description
//result for reponse data
}
@param completionBlock block to be called once operation is done. The result data contains all entries of the specified contenttype.
*/
- (void)find:(void (^) (ResponseType type,QueryResult * BUILT_NULLABLE_P result,NSError * BUILT_NULLABLE_P error))completionBlock;
- (void)findTaxonomy:(void (^) (ResponseType type,QueryResult * BUILT_NULLABLE_P result,NSError * BUILT_NULLABLE_P error))completionBlock;
/**
This method provides the first entry from a specified contenttype.
//Obj-C
[blogQuery findOne:^(ResponseType type, Entry *entry, NSError *error) {
//error for any error description
//result for reponse data
}];
//Swift
blogQuery.findOne { (responseType, entry!, error!) -> Void in
//error for any error description
//result for reponse data
}
@param completionBlock block to be called once operation is done.
*/
- (void)findOne:(void (^) (ResponseType type,Entry * BUILT_NULLABLE_P entry,NSError * BUILT_NULLABLE_P error))completionBlock;
//MARK: Cancel execution -
/**---------------------------------------------------------------------------------------
* @name Cancel execution
* ---------------------------------------------------------------------------------------
*/
/**
@abstract Advises the operation object that it should stop executing its task.
//Obj-C
[blogQuery cancelRequests];
//Swift
blogQuery.cancelRequests()
@discussion This method does not force your operation code to stop. Instead, it updates the object’s internal flags to reflect the change in state. If the operation has already finished executing, this method has no effect. Canceling an operation that is currently in an operation queue, but not yet executing, makes it possible to remove the operation from the queue sooner than usual.
*/
- (void)cancelRequests;
@end
BUILT_ASSUME_NONNULL_END
You can’t perform that action at this time.