// Code generated by "internal/generate/listpages/main.go -ListOps=GetAuthorizers -Paginator=Position"; DO NOT EDIT.

package apigateway

import (
	"context"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/apigateway"
	"github.com/aws/aws-sdk-go/service/apigateway/apigatewayiface"
)

func getAuthorizersPages(ctx context.Context, conn apigatewayiface.APIGatewayAPI, input *apigateway.GetAuthorizersInput, fn func(*apigateway.GetAuthorizersOutput, bool) bool) error {
	for {
		output, err := conn.GetAuthorizersWithContext(ctx, input)
		if err != nil {
			return err
		}

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

		input.Position = output.Position
	}
	return nil
}
