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.sdk
thrown 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 ) throws
Parameters
client
The
PageableClient
used to make calls for follow-up pages.request
The original
HTTPRequest
used to make the call.context
A
PipelineContext
object that will be used for follow-up page requests.data
The
Data
corresponding to the first page results.codingKeys
An optional set of
PagedCodingKeys
used to decode the paged results.decoder
An optional
JSONDecoder
for 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)