// Code generated by "internal/generate/listpages/main.go -ListOps=DescribeSpotFleetInstances,DescribeSpotFleetRequestHistory,DescribeVpcEndpointServices"; DO NOT EDIT.

package ec2

import (
	"context"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
)

func describeSpotFleetInstancesPages(ctx context.Context, conn ec2iface.EC2API, input *ec2.DescribeSpotFleetInstancesInput, fn func(*ec2.DescribeSpotFleetInstancesOutput, bool) bool) error {
	for {
		output, err := conn.DescribeSpotFleetInstancesWithContext(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 describeSpotFleetRequestHistoryPages(ctx context.Context, conn ec2iface.EC2API, input *ec2.DescribeSpotFleetRequestHistoryInput, fn func(*ec2.DescribeSpotFleetRequestHistoryOutput, bool) bool) error {
	for {
		output, err := conn.DescribeSpotFleetRequestHistoryWithContext(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 describeVPCEndpointServicesPages(ctx context.Context, conn ec2iface.EC2API, input *ec2.DescribeVpcEndpointServicesInput, fn func(*ec2.DescribeVpcEndpointServicesOutput, bool) bool) error {
	for {
		output, err := conn.DescribeVpcEndpointServicesWithContext(ctx, input)
		if err != nil {
			return err
		}

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

		input.NextToken = output.NextToken
	}
	return nil
}
