ARTPaginatedResult
Objective-C
@interface ARTPaginatedResult<ItemType> : NSObject
Swift
class ARTPaginatedResult<ItemType> : NSObject, @unchecked Sendable where ItemType : AnyObject
Contains a page of results for message or presence history, stats, or REST presence requests. An ARTPaginatedResult response from a REST API paginated query is also accompanied by metadata that indicates the relative queries available to the ARTPaginatedResult object.
-
Contains the current page of results; for example, an array of
ARTMessageorARTPresenceMessageobjects for a channel history request.Declaration
Objective-C
@property (nonatomic, readonly) NSArray<ItemType> *_Nonnull items;Swift
var items: [ItemType] { get } -
Returns
trueif there are more pages available by calling next and returnsfalseif this page is the last page available.Declaration
Objective-C
@property (nonatomic, readonly) BOOL hasNext;Swift
var hasNext: Bool { get } -
Returns
trueif this page is the last page and returnsfalseif there are more pages available by calling next available.Declaration
Objective-C
@property (nonatomic, readonly) BOOL isLast;Swift
var isLast: Bool { get } -
If you use this initializer, trying to call any of the methods or properties in
ARTPaginatedResultwill throw an exception; you must provide your own implementation in a subclass. This initializer exists purely to allow you to provide a mock implementation of this class in your tests.Declaration
Objective-C
- (nonnull instancetype)init;Swift
init() -
Returns a new
ARTPaginatedResultfor the first page of results.Declaration
Objective-C
- (void)first:(nonnull void (^)(ARTPaginatedResult<ItemType> *_Nullable, ARTErrorInfo *_Nullable))callback;Swift
func first(_ callback: @escaping (ARTPaginatedResult<ItemType>?, ARTErrorInfo?) -> Void)Parameters
callbackA callback for retriving an
ARTPaginatedResultobject with an array ofItemTypeobjects. -
Returns a new
ARTPaginatedResultloaded with the next page of results. If there are no further pages, thennilis returned.Declaration
Objective-C
- (void)next:(nonnull void (^)(ARTPaginatedResult<ItemType> *_Nullable, ARTErrorInfo *_Nullable))callback;Swift
func next(_ callback: @escaping (ARTPaginatedResult<ItemType>?, ARTErrorInfo?) -> Void)Parameters
callbackA callback for retriving an
ARTPaginatedResultobject with an array ofItemTypeobjects. -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) ARTRestInternal *restSwift
var rest: ARTRestInternal { get } -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) dispatch_queue_t userQueueSwift
var userQueue: dispatch_queue_t { get } -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) dispatch_queue_t queueSwift
var queue: dispatch_queue_t { get } -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) NSMutableURLRequest *relFirstSwift
var relFirst: NSMutableURLRequest { get } -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) NSMutableURLRequest *relCurrentSwift
var relCurrent: NSMutableURLRequest { get } -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) NSMutableURLRequest *relNextSwift
var relNext: NSMutableURLRequest { get } -
Undocumented
Declaration
Objective-C
- (instancetype)initWithItems:(NSArray *)items rest:(ARTRestInternal *)rest relFirst:(NSMutableURLRequest *)relFirst relCurrent:(NSMutableURLRequest *)relCurrent relNext:(NSMutableURLRequest *)relNext responseProcessor:(ARTPaginatedResultResponseProcessor)responseProcessor wrapperSDKAgents:(nullable NSStringDictionary *)wrapperSDKAgents logger:(ARTInternalLog *)logger NS_DESIGNATED_INITIALIZER;Swift
init(items: [Any], rest: ARTRestInternal, relFirst: NSMutableURLRequest, relCurrent: NSMutableURLRequest, relNext: NSMutableURLRequest, responseProcessor: @escaping ARTPaginatedResultResponseProcessor, wrapperSDKAgents: [String : String]?, logger: InternalLog) -
Undocumented
Declaration
Objective-C
+ (void)executePaginated:(ARTRestInternal *)rest withRequest:(NSMutableURLRequest *)request andResponseProcessor:(ARTPaginatedResultResponseProcessor)responseProcessor wrapperSDKAgents:(nullable NSStringDictionary *)wrapperSDKAgents logger:(ARTInternalLog *)logger callback:(void (^)(ARTPaginatedResult<ItemType> *_Nullable result, ARTErrorInfo *_Nullable error))callback;Swift
class func executePaginated(_ rest: ARTRestInternal, with request: NSMutableURLRequest, andResponseProcessor responseProcessor: @escaping ARTPaginatedResultResponseProcessor, wrapperSDKAgents: [String : String]?, logger: InternalLog, callback: @escaping (ARTPaginatedResult<ItemType>?, ARTErrorInfo?) -> Void) -
Undocumented
Declaration
Objective-C
@property (nullable, nonatomic, readonly) NSStringDictionary *wrapperSDKAgentsSwift
var wrapperSDKAgents: [String : String]? { get } -
Undocumented
Declaration
Objective-C
@property (nonatomic, readonly) ARTInternalLog *loggerSwift
var logger: InternalLog { get }