// Code generated by "internal/generate/listpages/main.go -ListOps=GetApis,GetApiMappings,GetDomainNames,GetVpcLinks"; DO NOT EDIT.

package apigatewayv2

import (
	"context"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/apigatewayv2"
	"github.com/aws/aws-sdk-go/service/apigatewayv2/apigatewayv2iface"
)

func getAPIMappingsPages(ctx context.Context, conn apigatewayv2iface.ApiGatewayV2API, input *apigatewayv2.GetApiMappingsInput, fn func(*apigatewayv2.GetApiMappingsOutput, bool) bool) error {
	for {
		output, err := conn.GetApiMappingsWithContext(ctx, input)
		if err != nil {
			return err
		}

		lastPage := aws.StringValue(output.NextToken) == ""
		if !fn(output, lastPage) || lastPage {
			break
		}

		input.NextToken = output.NextToken
	}
	return nil
}
func getAPIsPages(ctx context.Context, conn apigatewayv2iface.ApiGatewayV2API, input *apigatewayv2.GetApisInput, fn func(*apigatewayv2.GetApisOutput, bool) bool) error {
	for {
		output, err := conn.GetApisWithContext(ctx, input)
		if err != nil {
			return err
		}

		lastPage := aws.StringValue(output.NextToken) == ""
		if !fn(output, lastPage) || lastPage {
			break
		}

		input.NextToken = output.NextToken
	}
	return nil
}
func getDomainNamesPages(ctx context.Context, conn apigatewayv2iface.ApiGatewayV2API, input *apigatewayv2.GetDomainNamesInput, fn func(*apigatewayv2.GetDomainNamesOutput, bool) bool) error {
	for {
		output, err := conn.GetDomainNamesWithContext(ctx, input)
		if err != nil {
			return err
		}

		lastPage := aws.StringValue(output.NextToken) == ""
		if !fn(output, lastPage) || lastPage {
			break
		}

		input.NextToken = output.NextToken
	}
	return nil
}
func getVPCLinksPages(ctx context.Context, conn apigatewayv2iface.ApiGatewayV2API, input *apigatewayv2.GetVpcLinksInput, fn func(*apigatewayv2.GetVpcLinksOutput, bool) bool) error {
	for {
		output, err := conn.GetVpcLinksWithContext(ctx, input)
		if err != nil {
			return err
		}

		lastPage := aws.StringValue(output.NextToken) == ""
		if !fn(output, lastPage) || lastPage {
			break
		}

		input.NextToken = output.NextToken
	}
	return nil
}
