//===----------------------------------------------------------------------===//
//
// 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 SecurityHub {

    ///  Returns a list of the custom action targets in Security Hub in your account.
    public func describeActionTargetsPaginator(
        _ input: DescribeActionTargetsRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (DescribeActionTargetsResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: describeActionTargets, tokenKey: \DescribeActionTargetsResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Returns information about the available products that you can subscribe to and integrate with Security Hub in order to consolidate findings.
    public func describeProductsPaginator(
        _ input: DescribeProductsRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (DescribeProductsResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: describeProducts, tokenKey: \DescribeProductsResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Returns a list of the available standards in Security Hub. For each standard, the results include the standard ARN, the name, and a description. 
    public func describeStandardsPaginator(
        _ input: DescribeStandardsRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (DescribeStandardsResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: describeStandards, tokenKey: \DescribeStandardsResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Returns a list of security standards controls. For each control, the results include information about whether it is currently enabled, the severity, and a link to remediation information.
    public func describeStandardsControlsPaginator(
        _ input: DescribeStandardsControlsRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (DescribeStandardsControlsResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: describeStandardsControls, tokenKey: \DescribeStandardsControlsResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Returns a list of the standards that are currently enabled.
    public func getEnabledStandardsPaginator(
        _ input: GetEnabledStandardsRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (GetEnabledStandardsResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: getEnabledStandards, tokenKey: \GetEnabledStandardsResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Returns a list of findings that match the specified criteria.
    public func getFindingsPaginator(
        _ input: GetFindingsRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (GetFindingsResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: getFindings, tokenKey: \GetFindingsResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Lists and describes insights for the specified insight ARNs.
    public func getInsightsPaginator(
        _ input: GetInsightsRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (GetInsightsResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: getInsights, tokenKey: \GetInsightsResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Lists all findings-generating solutions (products) that you are subscribed to receive findings from in Security Hub.
    public func listEnabledProductsForImportPaginator(
        _ input: ListEnabledProductsForImportRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListEnabledProductsForImportResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listEnabledProductsForImport, tokenKey: \ListEnabledProductsForImportResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Lists all Security Hub membership invitations that were sent to the current AWS account. 
    public func listInvitationsPaginator(
        _ input: ListInvitationsRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListInvitationsResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listInvitations, tokenKey: \ListInvitationsResponse.nextToken, on: eventLoop, onPage: onPage)
    }

    ///  Lists details about all member accounts for the current Security Hub master account.
    public func listMembersPaginator(
        _ input: ListMembersRequest,
        on eventLoop: EventLoop? = nil,
        onPage: @escaping (ListMembersResponse,
        EventLoop) -> EventLoopFuture<Bool>
    ) -> EventLoopFuture<Void> {
        return client.paginate(input: input, command: listMembers, tokenKey: \ListMembersResponse.nextToken, on: eventLoop, onPage: onPage)
    }

}

extension SecurityHub.DescribeActionTargetsRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.DescribeActionTargetsRequest {
        return .init(
            actionTargetArns: self.actionTargetArns,
            maxResults: self.maxResults,
            nextToken: token
        )

    }
}

extension SecurityHub.DescribeProductsRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.DescribeProductsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )

    }
}

extension SecurityHub.DescribeStandardsRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.DescribeStandardsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )

    }
}

extension SecurityHub.DescribeStandardsControlsRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.DescribeStandardsControlsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            standardsSubscriptionArn: self.standardsSubscriptionArn
        )

    }
}

extension SecurityHub.GetEnabledStandardsRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.GetEnabledStandardsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            standardsSubscriptionArns: self.standardsSubscriptionArns
        )

    }
}

extension SecurityHub.GetFindingsRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.GetFindingsRequest {
        return .init(
            filters: self.filters,
            maxResults: self.maxResults,
            nextToken: token,
            sortCriteria: self.sortCriteria
        )

    }
}

extension SecurityHub.GetInsightsRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.GetInsightsRequest {
        return .init(
            insightArns: self.insightArns,
            maxResults: self.maxResults,
            nextToken: token
        )

    }
}

extension SecurityHub.ListEnabledProductsForImportRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.ListEnabledProductsForImportRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )

    }
}

extension SecurityHub.ListInvitationsRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.ListInvitationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )

    }
}

extension SecurityHub.ListMembersRequest: AWSPaginateToken {
    public func usingPaginationToken(_ token: String) -> SecurityHub.ListMembersRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            onlyAssociated: self.onlyAssociated
        )

    }
}


