//===----------------------------------------------------------------------===//
//
// This source file is part of the AWSSDKSwift open source project
//
// Copyright (c) 2017-2020 the AWSSDKSwift project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AWSSDKSwift project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// 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 CodeBuild {

    ///   Returns a list of details about test cases for a report. 
    public func describeTestCasesPaginator(
        _ input: DescribeTestCasesInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (DescribeTestCasesOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: describeTestCases, tokenKey: \DescribeTestCasesOutput.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Gets a list of build IDs, with each build ID representing a single build.
    public func listBuildsPaginator(
        _ input: ListBuildsInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListBuildsOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listBuilds, tokenKey: \ListBuildsOutput.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Gets a list of build IDs for the specified build project, with each build ID representing a single build.
    public func listBuildsForProjectPaginator(
        _ input: ListBuildsForProjectInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListBuildsForProjectOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listBuildsForProject, tokenKey: \ListBuildsForProjectOutput.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Gets a list of build project names, with each build project name representing a single build project.
    public func listProjectsPaginator(
        _ input: ListProjectsInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListProjectsOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listProjects, tokenKey: \ListProjectsOutput.nextToken, on: eventLoop, onPage: onPage)
    }

    ///   Gets a list ARNs for the report groups in the current AWS account. 
    public func listReportGroupsPaginator(
        _ input: ListReportGroupsInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListReportGroupsOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listReportGroups, tokenKey: \ListReportGroupsOutput.nextToken, on: eventLoop, onPage: onPage)
    }

    ///   Returns a list of ARNs for the reports in the current AWS account. 
    public func listReportsPaginator(
        _ input: ListReportsInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListReportsOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listReports, tokenKey: \ListReportsOutput.nextToken, on: eventLoop, onPage: onPage)
    }

    ///   Returns a list of ARNs for the reports that belong to a ReportGroup. 
    public func listReportsForReportGroupPaginator(
        _ input: ListReportsForReportGroupInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListReportsForReportGroupOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listReportsForReportGroup, tokenKey: \ListReportsForReportGroupOutput.nextToken, on: eventLoop, onPage: onPage)
    }

    ///   Gets a list of projects that are shared with other AWS accounts or users. 
    public func listSharedProjectsPaginator(
        _ input: ListSharedProjectsInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListSharedProjectsOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listSharedProjects, tokenKey: \ListSharedProjectsOutput.nextToken, on: eventLoop, onPage: onPage)
    }

    ///   Gets a list of report groups that are shared with other AWS accounts or users. 
    public func listSharedReportGroupsPaginator(
        _ input: ListSharedReportGroupsInput,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListSharedReportGroupsOutput,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listSharedReportGroups, tokenKey: \ListSharedReportGroupsOutput.nextToken, on: eventLoop, onPage: onPage)
    }

}

extension CodeBuild.DescribeTestCasesInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.DescribeTestCasesInput {
        return .init(
            filter: self.filter,
            maxResults: self.maxResults,
            nextToken: token,
            reportArn: self.reportArn
        )

    }
}

extension CodeBuild.ListBuildsInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.ListBuildsInput {
        return .init(
            nextToken: token,
            sortOrder: self.sortOrder
        )

    }
}

extension CodeBuild.ListBuildsForProjectInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.ListBuildsForProjectInput {
        return .init(
            nextToken: token,
            projectName: self.projectName,
            sortOrder: self.sortOrder
        )

    }
}

extension CodeBuild.ListProjectsInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.ListProjectsInput {
        return .init(
            nextToken: token,
            sortBy: self.sortBy,
            sortOrder: self.sortOrder
        )

    }
}

extension CodeBuild.ListReportGroupsInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.ListReportGroupsInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            sortBy: self.sortBy,
            sortOrder: self.sortOrder
        )

    }
}

extension CodeBuild.ListReportsInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.ListReportsInput {
        return .init(
            filter: self.filter,
            maxResults: self.maxResults,
            nextToken: token,
            sortOrder: self.sortOrder
        )

    }
}

extension CodeBuild.ListReportsForReportGroupInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.ListReportsForReportGroupInput {
        return .init(
            filter: self.filter,
            maxResults: self.maxResults,
            nextToken: token,
            reportGroupArn: self.reportGroupArn,
            sortOrder: self.sortOrder
        )

    }
}

extension CodeBuild.ListSharedProjectsInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.ListSharedProjectsInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            sortBy: self.sortBy,
            sortOrder: self.sortOrder
        )

    }
}

extension CodeBuild.ListSharedReportGroupsInput: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> CodeBuild.ListSharedReportGroupsInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            sortBy: self.sortBy,
            sortOrder: self.sortOrder
        )

    }
}


