PagedCollection
public class PagedCollection<SingleElement> where SingleElement : Decodable, SingleElement : Encodable
A collection that fetches paged results in a lazy fashion.
-
Undocumented
Declaration
Swift
public typealias Element = [SingleElement] -
Returns the current running list of items.
Declaration
Swift
public var items: Element? { get } -
Returns the subset of items that corresponds to the current page.
Declaration
Swift
public var pageItems: Element? { get } -
Returns the count of items that have been retrieved so far. There may be additional results, not yet fetched.
Declaration
Swift
public var underestimatedCount: Int { get } -
Returns true if there are no more results to fetch.
Declaration
Swift
public var isExhausted: Bool { get } -
Undocumented
See moreDeclaration
Swift
public struct PagedItemSyncIterator : Sequence, IteratorProtocol -
Returns a iterator to retrieve paged items one at a time.
Declaration
Swift
public var syncIterator: PagedItemSyncIterator { get }
-
<#Description#>
Throws
AzureErrors.sdkthrown if no data is returned from the server.Declaration
Swift
public init( client: PageableClient, request: HTTPRequest, context: PipelineContext, data: Data?, codingKeys: PagedCodingKeys? = nil, decoder: JSONDecoder? = nil ) throwsParameters
clientThe
PageableClientused to make calls for follow-up pages.requestThe original
HTTPRequestused to make the call.contextA
PipelineContextobject that will be used for follow-up page requests.dataThe
Datacorresponding to the first page results.codingKeysAn optional set of
PagedCodingKeysused to decode the paged results.decoderAn optional
JSONDecoderfor decoding special types.
-
Retrieves the next page of results asynchronously.
Declaration
Swift
public func nextPage(completionHandler: @escaping Continuation<Element>) -
nextPage()AsynchronousUndocumented
Declaration
Swift
public func nextPage() async throws -> [SingleElement] -
Retrieves the next item in the collection, automatically fetching new pages when needed.
Declaration
Swift
public func nextItem(completionHandler: @escaping Continuation<SingleElement>) -
nextItem()AsynchronousUndocumented
Declaration
Swift
public func nextItem() async throws -> SingleElement -
Undocumented
Declaration
Swift
public func forEachPage(progressHandler: @escaping (Element) -> Bool) -
Undocumented
Declaration
Swift
public func forEachItem(progressHandler: @escaping (SingleElement) -> Bool)
View on GitHub
PagedCollection Class Reference