import { Paginator } from "@aws-sdk/types" ; import { DescribeReplicationTaskAssessmentRunsCommand , DescribeReplicationTaskAssessmentRunsCommandInput , DescribeReplicationTaskAssessmentRunsCommandOutput , } from "../commands/DescribeReplicationTaskAssessmentRunsCommand" ; import { DatabaseMigrationService } from "../DatabaseMigrationService" ; import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient" ; import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces" ; private const makePagedClientRequest = async ( client , input , ... args ) : Promise < DescribeReplicationTaskAssessmentRunsCommandOutput > => { return await client . send ( new DescribeReplicationTaskAssessmentRunsCommand ( input ) , ... args ) ; } ; private const makePagedRequest = async ( client , input , ... args ) : Promise < DescribeReplicationTaskAssessmentRunsCommandOutput > => { return await client . describeReplicationTaskAssessmentRuns ( input , ... args ) ; } ; export async function * paginateDescribeReplicationTaskAssessmentRuns ( config , input , ... additionalArguments ) { let token = config . startingToken || undefined ; let hasNext = true ; let page ; while ( hasNext ) { input . Marker = token ; input [ "MaxRecords" ] = config . pageSize ; if ( config . client instanceof DatabaseMigrationService ) { page = await makePagedRequest ( config . client , input , ... additionalArguments ) ; } else if ( config . client instanceof DatabaseMigrationServiceClient ) { page = await makePagedClientRequest ( config . client , input , ... additionalArguments ) ; } else { throw new Error ( "Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient" ) ; } yield page ; token = page . Marker ; hasNext = ! ! token ; } return undefined ; }