func (r *Request) nextPageTokens() []interface{} {
	if r.Operation.Paginator == nil {
		return nil
	}
	if r.Operation.TruncationToken != "" {
		tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken)
		if len(tr) == 0 {
			return nil
		}
		switch v := tr[0].(type) {
		case *bool:
			if !aws.BoolValue(v) {
				return nil
			}
		case bool:
			if v == false {
				return nil
			}
		}
	}
	tokens := []interface{}{}
	tokenAdded := false
	for _, outToken := range r.Operation.OutputTokens {
		vs, _ := awsutil.ValuesAtPath(r.Data, outToken)
		if len(vs) == 0 {
			tokens = append(tokens, nil)
			continue
		}
		v := vs[0]
		switch tv := v.(type) {
		case *string:
			if len(aws.StringValue(tv)) == 0 {
				tokens = append(tokens, nil)
				continue
			}
		case string:
			if len(tv) == 0 {
				tokens = append(tokens, nil)
				continue
			}
		}
		tokenAdded = true
		tokens = append(tokens, v)
	}
	if !tokenAdded {
		return nil
	}
	return tokens
}
nextPageTokens returns the tokens to use when asking for the next page of data.
package request
import (
	"reflect"
	"sync/atomic"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awsutil"
)
type Pagination struct {
	NewRequest func() (*Request, error)
	EndPageOnSameToken bool
	started    bool
	prevTokens []interface{}
	nextTokens []interface{}
	err     error
	curPage interface{}
}
func (p *Pagination) HasNextPage() bool {
	if !p.started {
		return true
	}
	hasNextPage := len(p.nextTokens) != 0
	if p.EndPageOnSameToken {
		return hasNextPage && !awsutil.DeepEqual(p.nextTokens, p.prevTokens)
	}
	return hasNextPage
}
func (p *Pagination) Err() error {
	return p.err
}
func (p *Pagination) Page() interface{} {
	return p.curPage
}
func (p *Pagination) Next() bool {
	if !p.HasNextPage() {
		return false
	}
	req, err := p.NewRequest()
	if err != nil {
		p.err = err
		return false
	}
	if p.started {
		for i, intok := range req.Operation.InputTokens {
			awsutil.SetValueAtPath(req.Params, intok, p.nextTokens[i])
		}
	}
	p.started = true
	err = req.Send()
	if err != nil {
		p.err = err
		return false
	}
	p.prevTokens = p.nextTokens
	p.nextTokens = req.nextPageTokens()
	p.curPage = req.Data
	return true
}
type Paginator struct {
	InputTokens     []string
	OutputTokens    []string
	LimitToken      string
	TruncationToken string
}