commit | author | age
|
655e66
|
1 |
/* |
H |
2 |
* Copyright (C) 2017 Twitter, Inc. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
* |
|
16 |
*/ |
a0a843
|
17 |
|
H |
18 |
#import <Foundation/Foundation.h> |
|
19 |
#import <TwitterKit/TWTRTimelineDataSource.h> |
|
20 |
|
|
21 |
@class TWTRAPIClient; |
|
22 |
@class TWTRTimelineFilter; |
|
23 |
|
|
24 |
NS_ASSUME_NONNULL_BEGIN |
|
25 |
|
|
26 |
/** |
|
27 |
* Data source representing a list of Tweets. These Tweets are ordered chronologically with the most recent first. |
|
28 |
* |
|
29 |
* @see https://dev.twitter.com/rest/reference/get/lists/statuses |
|
30 |
*/ |
|
31 |
@interface TWTRListTimelineDataSource : NSObject <TWTRTimelineDataSource> |
|
32 |
|
|
33 |
/** |
|
34 |
* The ID of the list to show Tweets for. Either the `listID` or the `listSlug` and `listOwnerScreenName` are required. |
|
35 |
*/ |
|
36 |
@property (nonatomic, copy, readonly) NSString *listID; |
|
37 |
|
|
38 |
/** |
|
39 |
* The slug of the list to show Tweets for. Either the `listID` or the `listSlug` and `listOwnerScreenName` are required. |
|
40 |
*/ |
|
41 |
@property (nonatomic, copy, readonly) NSString *listSlug; |
|
42 |
|
|
43 |
/** |
|
44 |
* Screen name of the owner of the list as specified by the `listSlug`. Either the `listID` or the `listSlug` and `listOwnerScreenName` are required. |
|
45 |
*/ |
|
46 |
@property (nonatomic, copy, readonly) NSString *listOwnerScreenName; |
|
47 |
|
|
48 |
/** |
|
49 |
* The number of Tweets to request in each query to the Twitter Timeline API when fetching the next batch of Tweets. Will request 30 Tweets by default. Setting this value to 0 will use the server default. |
|
50 |
*/ |
|
51 |
@property (nonatomic, readonly) NSUInteger maxTweetsPerRequest; |
|
52 |
|
|
53 |
/** |
|
54 |
* Whether to request retweets in the set of Tweets from the server. |
|
55 |
* |
|
56 |
* Defaults to YES. |
|
57 |
*/ |
|
58 |
@property (nonatomic, readonly) BOOL includeRetweets; |
|
59 |
|
|
60 |
/* |
|
61 |
* A filtering object that hides certain tweets. |
|
62 |
*/ |
|
63 |
@property (nonatomic, copy, nullable) TWTRTimelineFilter *timelineFilter; |
|
64 |
|
|
65 |
/** |
|
66 |
* Convenience initializer. Uses default values for `maxTweetsPerRequest` and `includeRetweets`. |
|
67 |
* |
|
68 |
* @param listID (required) The ID of the list. |
|
69 |
* @param client (required) The API client to use for making network requests. |
|
70 |
* |
|
71 |
* @return A full initialized list timeline datasource. |
|
72 |
*/ |
|
73 |
- (instancetype)initWithListID:(NSString *)listID APIClient:(TWTRAPIClient *)client; |
|
74 |
|
|
75 |
/** |
|
76 |
* Convenience initializer. Uses default values for `maxTweetsPerRequest` and `includeRetweets`. |
|
77 |
* |
|
78 |
* @param listSlug (required) The slug of the list. |
|
79 |
* @param listOwnerScreenName (required) The list owner's screen name. |
|
80 |
* @param client (required) The API client to use for making network requests. |
|
81 |
* |
|
82 |
* @return A full initialized list timeline datasource. |
|
83 |
*/ |
|
84 |
- (instancetype)initWithListSlug:(NSString *)listSlug listOwnerScreenName:(NSString *)listOwnerScreenName APIClient:(TWTRAPIClient *)client; |
|
85 |
|
|
86 |
/** |
|
87 |
* Designated initializer for creating list timeline data sources taking all parameters. |
|
88 |
* |
|
89 |
* @param listID (optional) The ID of the list. Provide either the `listID` or `listSlug` and `listOwnerScreenName`. |
|
90 |
* @param listSlug (optional) The slug of the list. Provide either the `listID` or `listSlug` and `listOwnerScreenName`. |
|
91 |
* @param listOwnerScreenName (optional) The list owner's screen name. Provide either the `listID` or `listSlug` and `listOwnerScreenName`. |
|
92 |
* @param client (required) The API client to use for making networking requests |
|
93 |
* @param maxTweetsPerRequest (optional) The number of Tweets per batch to request. A value of 0 will use the server default. |
|
94 |
* @param includeRetweets (optional) Whether retweets should be requested. |
|
95 |
* |
|
96 |
* @return A fully initialized list timeline datasource. |
|
97 |
*/ |
|
98 |
- (instancetype)initWithListID:(nullable NSString *)listID listSlug:(nullable NSString *)listSlug listOwnerScreenName:(nullable NSString *)listOwnerScreenName APIClient:(TWTRAPIClient *)client maxTweetsPerRequest:(NSUInteger)maxTweetsPerRequest includeRetweets:(BOOL)includeRetweets NS_DESIGNATED_INITIALIZER; |
|
99 |
|
|
100 |
- (instancetype)init NS_UNAVAILABLE; |
|
101 |
|
|
102 |
@end |
|
103 |
|
|
104 |
NS_ASSUME_NONNULL_END |