// Code generated by "internal/generate/listpages/main.go -ListOps=DescribeInstanceRefreshes,DescribeLoadBalancers,DescribeLoadBalancerTargetGroups,DescribeWarmPool"; DO NOT EDIT.

package autoscaling

import (
	"context"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/autoscaling"
	"github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface"
)

func describeInstanceRefreshesPages(ctx context.Context, conn autoscalingiface.AutoScalingAPI, input *autoscaling.DescribeInstanceRefreshesInput, fn func(*autoscaling.DescribeInstanceRefreshesOutput, bool) bool) error {
	for {
		output, err := conn.DescribeInstanceRefreshesWithContext(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 describeLoadBalancerTargetGroupsPages(ctx context.Context, conn autoscalingiface.AutoScalingAPI, input *autoscaling.DescribeLoadBalancerTargetGroupsInput, fn func(*autoscaling.DescribeLoadBalancerTargetGroupsOutput, bool) bool) error {
	for {
		output, err := conn.DescribeLoadBalancerTargetGroupsWithContext(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 describeLoadBalancersPages(ctx context.Context, conn autoscalingiface.AutoScalingAPI, input *autoscaling.DescribeLoadBalancersInput, fn func(*autoscaling.DescribeLoadBalancersOutput, bool) bool) error {
	for {
		output, err := conn.DescribeLoadBalancersWithContext(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 describeWarmPoolPages(ctx context.Context, conn autoscalingiface.AutoScalingAPI, input *autoscaling.DescribeWarmPoolInput, fn func(*autoscaling.DescribeWarmPoolOutput, bool) bool) error {
	for {
		output, err := conn.DescribeWarmPoolWithContext(ctx, input)
		if err != nil {
			return err
		}

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

		input.NextToken = output.NextToken
	}
	return nil
}
