// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/swift-aws/aws-sdk-swift/blob/master/CodeGenerator/Sources/CodeGenerator/main.swift. DO NOT EDIT.

import NIO

//MARK: Paginators

extension MediaPackage {

    ///  Returns a collection of Channels.
    public func listChannelsPaginator(_ input: ListChannelsRequest, onPage: @escaping (ListChannelsResponse, EventLoop)->EventLoopFuture<Bool>) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listChannels, tokenKey: \ListChannelsResponse.nextToken, onPage: onPage)
    }

    ///  Returns a collection of HarvestJob records.
    public func listHarvestJobsPaginator(_ input: ListHarvestJobsRequest, onPage: @escaping (ListHarvestJobsResponse, EventLoop)->EventLoopFuture<Bool>) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listHarvestJobs, tokenKey: \ListHarvestJobsResponse.nextToken, onPage: onPage)
    }

    ///  Returns a collection of OriginEndpoint records.
    public func listOriginEndpointsPaginator(_ input: ListOriginEndpointsRequest, onPage: @escaping (ListOriginEndpointsResponse, EventLoop)->EventLoopFuture<Bool>) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listOriginEndpoints, tokenKey: \ListOriginEndpointsResponse.nextToken, onPage: onPage)
    }

}

extension MediaPackage.ListChannelsRequest: AWSPaginateStringToken {
    public func usingPaginationToken(_ token: String) -> MediaPackage.ListChannelsRequest {
        return .init(
            maxResults: self.maxResults, 
            nextToken: token
        )

    }
}

extension MediaPackage.ListHarvestJobsRequest: AWSPaginateStringToken {
    public func usingPaginationToken(_ token: String) -> MediaPackage.ListHarvestJobsRequest {
        return .init(
            includeChannelId: self.includeChannelId, 
            includeStatus: self.includeStatus, 
            maxResults: self.maxResults, 
            nextToken: token
        )

    }
}

extension MediaPackage.ListOriginEndpointsRequest: AWSPaginateStringToken {
    public func usingPaginationToken(_ token: String) -> MediaPackage.ListOriginEndpointsRequest {
        return .init(
            channelId: self.channelId, 
            maxResults: self.maxResults, 
            nextToken: token
        )

    }
}


